managebranchpriv.ui.js 698 B

1234567891011121314151617181920212223242526
  1. window.getMenu = function(item)
  2. {
  3. const selectedBranches = [];
  4. $('.pick-value[name^=name]').each(function()
  5. {
  6. const name = $(this).val();
  7. if(name) selectedBranches.push(name);
  8. });
  9. item.disabled = selectedBranches.includes(item.text);
  10. return item;
  11. }
  12. window.onRenderRow = function(row, rowIdx, data)
  13. {
  14. if(!data) return;
  15. row.find('[data-name="name"]').find('.picker-box').on('inited', function(_, info)
  16. {
  17. if(hasAccessBranches[data.name])
  18. {
  19. const branchs = [{text: data.name, value: data.name}];
  20. info[0].render({disabled: true, required: true, items: branchs, defaultValue: data.name});
  21. }
  22. });
  23. }