|
@@ -22,15 +22,15 @@
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
$.extend($.fn.bootstrapTable.defaults, {
|
|
$.extend($.fn.bootstrapTable.defaults, {
|
|
|
- reorderable: false,
|
|
|
|
|
|
|
+ reorderableColumns: false,
|
|
|
maxMovingRows: 10,
|
|
maxMovingRows: 10,
|
|
|
- onReorder: function (headerFields) {
|
|
|
|
|
|
|
+ onReorderColumn: function (headerFields) {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
$.extend($.fn.bootstrapTable.Constructor.EVENTS, {
|
|
$.extend($.fn.bootstrapTable.Constructor.EVENTS, {
|
|
|
- 'reorder.bs.table': 'onReorder'
|
|
|
|
|
|
|
+ 'reorder-column.bs.table': 'onReorderColumn'
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
var BootstrapTable = $.fn.bootstrapTable.Constructor,
|
|
var BootstrapTable = $.fn.bootstrapTable.Constructor,
|
|
@@ -42,27 +42,27 @@
|
|
|
BootstrapTable.prototype.initHeader = function () {
|
|
BootstrapTable.prototype.initHeader = function () {
|
|
|
_initHeader.apply(this, Array.prototype.slice.apply(arguments));
|
|
_initHeader.apply(this, Array.prototype.slice.apply(arguments));
|
|
|
|
|
|
|
|
- if (!this.options.reorderable) {
|
|
|
|
|
|
|
+ if (!this.options.reorderableColumns) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- this.makeColumnsReorderable();
|
|
|
|
|
|
|
+ this.makeRowsReorderable();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
BootstrapTable.prototype.toggleColumn = function () {
|
|
BootstrapTable.prototype.toggleColumn = function () {
|
|
|
_toggleColumn.apply(this, Array.prototype.slice.apply(arguments));
|
|
_toggleColumn.apply(this, Array.prototype.slice.apply(arguments));
|
|
|
|
|
|
|
|
- if (!this.options.reorderable) {
|
|
|
|
|
|
|
+ if (!this.options.reorderableColumns) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- this.makeColumnsReorderable();
|
|
|
|
|
|
|
+ this.makeRowsReorderable();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
BootstrapTable.prototype.toggleView = function () {
|
|
BootstrapTable.prototype.toggleView = function () {
|
|
|
_toggleView.apply(this, Array.prototype.slice.apply(arguments));
|
|
_toggleView.apply(this, Array.prototype.slice.apply(arguments));
|
|
|
|
|
|
|
|
- if (!this.options.reorderable) {
|
|
|
|
|
|
|
+ if (!this.options.reorderableColumns) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -70,20 +70,20 @@
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- this.makeColumnsReorderable();
|
|
|
|
|
|
|
+ this.makeRowsReorderable();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
BootstrapTable.prototype.resetView = function () {
|
|
BootstrapTable.prototype.resetView = function () {
|
|
|
_resetView.apply(this, Array.prototype.slice.apply(arguments));
|
|
_resetView.apply(this, Array.prototype.slice.apply(arguments));
|
|
|
|
|
|
|
|
- if (!this.options.reorderable) {
|
|
|
|
|
|
|
+ if (!this.options.reorderableColumns) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- this.makeColumnsReorderable();
|
|
|
|
|
|
|
+ this.makeRowsReorderable();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- BootstrapTable.prototype.makeColumnsReorderable = function () {
|
|
|
|
|
|
|
+ BootstrapTable.prototype.makeRowsReorderable = function () {
|
|
|
|
|
|
|
|
var that = this;
|
|
var that = this;
|
|
|
try {
|
|
try {
|
|
@@ -111,7 +111,7 @@
|
|
|
that.options.columns = that.options.columns.concat(columns);
|
|
that.options.columns = that.options.columns.concat(columns);
|
|
|
that.header.fields = ths;
|
|
that.header.fields = ths;
|
|
|
that.resetView();
|
|
that.resetView();
|
|
|
- that.trigger('reorder', ths);
|
|
|
|
|
|
|
+ that.trigger('reorder-column', ths);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|