Browse Source

Merge pull request #1883 from coffy/enh-updateCell

Added new param for updateCell method to avoid table reinitialization
wenzhixin 10 years ago
parent
commit
01f73c2d07
2 changed files with 7 additions and 1 deletions
  1. 2 0
      docs/_i18n/en/documentation/methods.md
  2. 5 1
      src/bootstrap-table.js

+ 2 - 0
docs/_i18n/en/documentation/methods.md

@@ -161,6 +161,8 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter);`.
         index: the row index. <br>
         field: the field name.<br>
         value: the new field value.
+        <br>
+        To disable table re-initialization you can set <code>{reinit: false}</code>
         </td>
     </tr>
     <tr>

+ 5 - 1
src/bootstrap-table.js

@@ -1775,7 +1775,7 @@
     BootstrapTable.prototype.initServer = function (silent, query) {
         var that = this,
             data = {},
-            params = {                
+            params = {
                 searchText: this.searchText,
                 sortName: this.options.sortName,
                 sortOrder: this.options.sortOrder
@@ -2403,6 +2403,10 @@
             return;
         }
         this.data[params.index][params.field] = params.value;
+
+        if (params.reinit === false) {
+            return;
+        }
         this.initSort();
         this.initBody(true);
     };