batchedit.ui.js 950 B

12345678910111213141516171819202122232425262728293031
  1. window.renderRowData = function($row, index, row)
  2. {
  3. const disabled = ['risk', 'issue', 'opportunity'].includes(row.objectType);
  4. /* Set disabled to product. */
  5. if(row.product != undefined)
  6. {
  7. $row.find('[data-name="product"]').find('.picker-box').on('inited', function(e, info)
  8. {
  9. info[0].render({disabled: disabled || shadowProducts[row.product] != undefined});
  10. });
  11. }
  12. /* Set disabled to execution. */
  13. if(row.execution != undefined)
  14. {
  15. $row.find('[data-name="execution"]').find('.picker-box').on('inited', function(e, info)
  16. {
  17. info[0].render({disabled: disabled});
  18. });
  19. }
  20. /* Set disabled to left. */
  21. if(row.left != undefined)
  22. {
  23. const $left = $row.find('[data-name="left"] input');
  24. const attr = row.objectType != 'task' ? 'disabled' : 'readonly';
  25. $left.attr(attr, true);
  26. $left.addClass(attr);
  27. }
  28. }