product.ui.js 662 B

1234567891011121314151617181920212223
  1. /**
  2. * Submit data to product batch edit page by html form while click on the batch edit button.
  3. */
  4. $(document).off('click', '[data-formaction]').on('click', '[data-formaction]', function()
  5. {
  6. const $this = $(this);
  7. const dtable = zui.DTable.query($('#products'));
  8. const checkedList = dtable.$.getChecks();
  9. if(!checkedList.length) return;
  10. const formData = new FormData();
  11. checkedList.forEach(function(id)
  12. {
  13. formData.append('productIDList[]', id);
  14. });
  15. postAndLoadPage($this.data('formaction'), formData);
  16. });
  17. window.footerSummary = function(checkedIdList, pageSummary)
  18. {
  19. return {html: pageSummary};
  20. }