ソースを参照

Added new param for updateCell method to avoid table reinitialization

new parameter for updateCell method. Providing {reinit:false} initSort
and initBody methods are not executed. New option helps to solve issue
#1498
coffy 10 年 前
コミット
55911a1afa
2 ファイル変更6 行追加1 行削除
  1. 2 0
      docs/_i18n/en/documentation/methods.md
  2. 4 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>

+ 4 - 1
src/bootstrap-table.js

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