|
|
@@ -2386,19 +2386,24 @@
|
|
|
};
|
|
|
|
|
|
BootstrapTable.prototype.updateByUniqueId = function (params) {
|
|
|
- var rowId;
|
|
|
+ var that = this;
|
|
|
+ var allParams = $.isArray(params) ? params : [ params ];
|
|
|
|
|
|
- if (!params.hasOwnProperty('id') || !params.hasOwnProperty('row')) {
|
|
|
- return;
|
|
|
- }
|
|
|
+ $.each(allParams, function(i, params) {
|
|
|
+ var rowId;
|
|
|
|
|
|
- rowId = $.inArray(this.getRowByUniqueId(params.id), this.options.data);
|
|
|
+ if (!params.hasOwnProperty('id') || !params.hasOwnProperty('row')) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- if (rowId === -1) {
|
|
|
- return;
|
|
|
- }
|
|
|
+ rowId = $.inArray(that.getRowByUniqueId(params.id), that.options.data);
|
|
|
+
|
|
|
+ if (rowId === -1) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $.extend(that.data[rowId], params.row);
|
|
|
+ });
|
|
|
|
|
|
- $.extend(this.data[rowId], params.row);
|
|
|
this.initSort();
|
|
|
this.initBody(true);
|
|
|
};
|
|
|
@@ -2415,10 +2420,16 @@
|
|
|
};
|
|
|
|
|
|
BootstrapTable.prototype.updateRow = function (params) {
|
|
|
- if (!params.hasOwnProperty('index') || !params.hasOwnProperty('row')) {
|
|
|
- return;
|
|
|
- }
|
|
|
- $.extend(this.data[params.index], params.row);
|
|
|
+ var that = this;
|
|
|
+ var allParams = $.isArray(params) ? params : [ params ];
|
|
|
+
|
|
|
+ $.each(allParams, function(i, params) {
|
|
|
+ if (!params.hasOwnProperty('index') || !params.hasOwnProperty('row')) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $.extend(that.data[params.index], params.row);
|
|
|
+ });
|
|
|
+
|
|
|
this.initSort();
|
|
|
this.initBody(true);
|
|
|
};
|
|
|
@@ -2653,6 +2664,12 @@
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+ BootstrapTable.prototype.getVisibleColumns = function () {
|
|
|
+ return $.grep(this.columns, function (column) {
|
|
|
+ return column.visible;
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
BootstrapTable.prototype.toggleAllColumns = function (visible) {
|
|
|
$.each(this.columns, function (i, column) {
|
|
|
this.columns[i].visible = visible;
|
|
|
@@ -2846,7 +2863,7 @@
|
|
|
'resetWidth',
|
|
|
'destroy',
|
|
|
'showLoading', 'hideLoading',
|
|
|
- 'showColumn', 'hideColumn', 'getHiddenColumns',
|
|
|
+ 'showColumn', 'hideColumn', 'getHiddenColumns', 'getVisibleColumns',
|
|
|
'showAllColumns', 'hideAllColumns',
|
|
|
'filterBy',
|
|
|
'scrollTo',
|