table-editable.int.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /******/ (function() { // webpackBootstrap
  2. var __webpack_exports__ = {};
  3. /*!**************************************************!*\
  4. !*** ./resources/js/pages/table-editable.int.js ***!
  5. \**************************************************/
  6. /*
  7. Template Name: Skote - Admin & Dashboard Template
  8. Author: Themesbrand
  9. Website: https://themesbrand.com/
  10. Contact: themesbrand@gmail.com
  11. File: Table editable Init Js File
  12. */
  13. // table edits table
  14. $(function () {
  15. var pickers = {};
  16. $('.table-edits tr').editable({
  17. dropdowns: {
  18. gender: ['Male', 'Female']
  19. },
  20. edit: function edit(values) {
  21. $(".edit i", this).removeClass('fa-pencil-alt').addClass('fa-save').attr('title', 'Save');
  22. },
  23. save: function save(values) {
  24. $(".edit i", this).removeClass('fa-save').addClass('fa-pencil-alt').attr('title', 'Edit');
  25. if (this in pickers) {
  26. pickers[this].destroy();
  27. delete pickers[this];
  28. }
  29. },
  30. cancel: function cancel(values) {
  31. $(".edit i", this).removeClass('fa-save').addClass('fa-pencil-alt').attr('title', 'Edit');
  32. if (this in pickers) {
  33. pickers[this].destroy();
  34. delete pickers[this];
  35. }
  36. }
  37. });
  38. });
  39. /******/ })()
  40. ;