collection.js 721 B

123456789101112131415161718192021
  1. define(['jquery', 'bootstrap', 'frontend', 'template', 'form'], function ($, undefined, Frontend, Template, Form) {
  2. var Controller = {
  3. index: function () {
  4. $(document).on('click', '.btn-delete', function () {
  5. var that = this;
  6. var url = $(that).data("url");
  7. var id = $(that).data("id");
  8. Fast.api.ajax({
  9. url: url,
  10. data: {id: id}
  11. }, function (data) {
  12. setTimeout(function () {
  13. location.reload();
  14. }, 1500);
  15. });
  16. return false;
  17. });
  18. },
  19. };
  20. return Controller;
  21. });