linktask.ui.js 939 B

1234567891011121314151617181920212223242526272829303132
  1. window.createSortLink = function(col)
  2. {
  3. var sort = col.name + '_asc';
  4. if(sort == orderBy) sort = col.name + '_desc';
  5. return "javascript:loadTarget('" + sortLink.replace('{orderBy}', sort) + "', 'mr-task')";
  6. }
  7. $(document).off('click','.dtable-footer .batch-btn').on('click', '.dtable-footer .batch-btn', function(e)
  8. {
  9. const dtable = zui.DTable.query(e.target);
  10. const checkedList = dtable.$.getChecks();
  11. if(!checkedList.length) return;
  12. const tabType = $(this).data('type');
  13. const postData = new FormData();
  14. checkedList.forEach((id) => postData.append(`${tabType}[]`, id));
  15. $.ajaxSubmit({
  16. url: $(this).data('url'),
  17. data: postData
  18. });
  19. $(this).prop('disabled', true);
  20. });
  21. window.onSearchFormResult = function(formName, response)
  22. {
  23. response.then(res => res.json())
  24. .then(json => {
  25. loadTarget(json.load, 'mr-task');
  26. }).catch(console.error);
  27. }