bootstrap-table-resizable.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /**
  2. * @author: Dennis Hernández
  3. * @webSite: http://djhvscf.github.io/Blog
  4. * @version: v1.0.0
  5. */
  6. (function ($) {
  7. 'use strict';
  8. $.extend($.fn.bootstrapTable.defaults, {
  9. resizable: false,
  10. liveDrag: false,
  11. fixed: true,
  12. headerOnly: false,
  13. minWidth: 15,
  14. hoverCursor: 'e-resize',
  15. dragCursor: 'e-resize',
  16. onResizableResize: function (e) {
  17. return false;
  18. },
  19. onResizableDrag: function (e) {
  20. return false;
  21. }
  22. });
  23. var BootstrapTable = $.fn.bootstrapTable.Constructor,
  24. _init = BootstrapTable.prototype.init;
  25. BootstrapTable.prototype.init = function () {
  26. var that = this;
  27. _init.apply(this, Array.prototype.slice.apply(arguments));
  28. if (this.options.resizable) {
  29. $(this.$el).colResizable({
  30. liveDrag: that.options.liveDrag,
  31. fixed: that.options.fixed,
  32. headerOnly: that.options.headerOnly,
  33. minWidth: that.options.minWidth,
  34. hoverCursor: that.options.hoverCursor,
  35. dragCursor: that.options.dragCursor,
  36. onResize: that.options.onResizableResize,
  37. onDrag: that.options.onResizableDrag
  38. });
  39. }
  40. };
  41. })(jQuery);