|
|
@@ -336,6 +336,10 @@
|
|
|
detailClose: 'glyphicon-minus icon-minus'
|
|
|
},
|
|
|
|
|
|
+ customSearch: $.noop,
|
|
|
+
|
|
|
+ customSort: $.noop,
|
|
|
+
|
|
|
rowStyle: function (row, index) {
|
|
|
return {};
|
|
|
},
|
|
|
@@ -860,6 +864,11 @@
|
|
|
order = this.options.sortOrder === 'desc' ? -1 : 1,
|
|
|
index = $.inArray(this.options.sortName, this.header.fields);
|
|
|
|
|
|
+ if (this.options.customSort !== $.noop) {
|
|
|
+ this.options.customSort.apply(this, [this.options.sortName, this.options.sortOrder]);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
if (index !== -1) {
|
|
|
this.data.sort(function (a, b) {
|
|
|
if (that.header.sortNames[index]) {
|
|
|
@@ -1125,6 +1134,10 @@
|
|
|
var that = this;
|
|
|
|
|
|
if (this.options.sidePagination !== 'server') {
|
|
|
+ if (this.options.customSearch !== $.noop) {
|
|
|
+ this.options.customSearch.apply(this, [this.searchText]);
|
|
|
+ return;
|
|
|
+ }
|
|
|
var s = this.searchText && this.searchText.toLowerCase();
|
|
|
var f = $.isEmptyObject(this.filterColumns) ? null : this.filterColumns;
|
|
|
|
|
|
@@ -2588,6 +2601,32 @@
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+ BootstrapTable.prototype.toggleAllColumns = function (visible) {
|
|
|
+ $.each(this.columns, function (i, column) {
|
|
|
+ this.columns[i].visible = visible;
|
|
|
+ });
|
|
|
+
|
|
|
+ this.initHeader();
|
|
|
+ this.initSearch();
|
|
|
+ this.initPagination();
|
|
|
+ this.initBody();
|
|
|
+ if (this.options.showColumns) {
|
|
|
+ var $items = this.$toolbar.find('.keep-open input').prop('disabled', false);
|
|
|
+
|
|
|
+ if ($items.filter(':checked').length <= this.options.minimumCountColumns) {
|
|
|
+ $items.filter(':checked').prop('disabled', true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ BootstrapTable.prototype.showAllColumns = function () {
|
|
|
+ this.toggleAllColumns(true);
|
|
|
+ };
|
|
|
+
|
|
|
+ BootstrapTable.prototype.hideAllColumns = function () {
|
|
|
+ this.toggleAllColumns(false);
|
|
|
+ };
|
|
|
+
|
|
|
BootstrapTable.prototype.filterBy = function (columns) {
|
|
|
this.filterColumns = $.isEmptyObject(columns) ? {} : columns;
|
|
|
this.options.pageNumber = 1;
|
|
|
@@ -2756,6 +2795,7 @@
|
|
|
'destroy',
|
|
|
'showLoading', 'hideLoading',
|
|
|
'showColumn', 'hideColumn', 'getHiddenColumns',
|
|
|
+ 'showAllColumns', 'hideAllColumns',
|
|
|
'filterBy',
|
|
|
'scrollTo',
|
|
|
'getScrollPosition',
|
|
|
@@ -2811,7 +2851,8 @@
|
|
|
sprintf: sprintf,
|
|
|
getFieldIndex: getFieldIndex,
|
|
|
compareObjects: compareObjects,
|
|
|
- calculateObjectValue: calculateObjectValue
|
|
|
+ calculateObjectValue: calculateObjectValue,
|
|
|
+ getItemField: getItemField
|
|
|
};
|
|
|
|
|
|
// BOOTSTRAP TABLE INIT
|