addons.js 886 B

12345678910111213141516171819202122232425262728
  1. define([], function () {
  2. require.config({
  3. paths: {
  4. 'editable': '../libs/bootstrap-table/dist/extensions/editable/bootstrap-table-editable.min',
  5. 'x-editable': '../addons/editable/js/bootstrap-editable.min',
  6. },
  7. shim: {
  8. 'editable': {
  9. deps: ['x-editable', 'bootstrap-table']
  10. },
  11. "x-editable": {
  12. deps: ["css!../addons/editable/css/bootstrap-editable.css"],
  13. }
  14. }
  15. });
  16. if ($("table.table").size() > 0) {
  17. require(['editable', 'table'], function (Editable, Table) {
  18. $.fn.bootstrapTable.defaults.onEditableSave = function (field, row, oldValue, $el) {
  19. var data = {};
  20. data["row[" + field + "]"] = row[field];
  21. Fast.api.ajax({
  22. url: this.extend.edit_url + "/ids/" + row[this.pk],
  23. data: data
  24. });
  25. };
  26. });
  27. }
  28. });