ソースを参照

Fix #1166 Silently sorting with serverside pagination

Dennis Hernández 10 年 前
コミット
d0119bbf09

+ 7 - 0
docs/_i18n/en/documentation/table-options.md

@@ -473,6 +473,13 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
         <td>False to disable sortable of all columns.</td>
     </tr>
     <tr>
+        <td>silentSort</td>
+        <td>data-silent-sort</td>
+        <td>Boolean</td>
+        <td>true</td>
+        <td>Set <code>false</code> to sort the data silently. This options works when the sidePagination option is set to <code>server</code>.</td>
+    </tr>
+    <tr>
         <td>rowStyle</td>
         <td>data-row-style</td>
         <td>Function</td>

+ 7 - 0
docs/_i18n/es/documentation/table-options.md

@@ -448,6 +448,13 @@ Las opciones de la tabla están definidas en `jQuery.fn.bootstrapTable.defaults`
         <td>False para deshabilitar el ordenamiento en todas las columnas.</td>
     </tr>
     <tr>
+        <td>silentSort</td>
+        <td>data-silent-sort</td>
+        <td>Boolean</td>
+        <td>true</td>
+        <td>Setear a <code>false</code> para ordenar los datos silenciosamente. Esta opción funciona cuando la opción sidePagination es seteada a <code>server</code>.</td>
+    </tr>
+    <tr>
         <td>rowStyle</td>
         <td>data-row-style</td>
         <td>Function</td>

+ 7 - 0
docs/_i18n/zh-cn/documentation/table-options.md

@@ -468,6 +468,13 @@ The table options is defined in `jQuery.fn.bootstrapTable.defaults`.
         <td>False to disable sortable of all columns.</td>
     </tr>
     <tr>
+        <td>silentSort</td>
+        <td>data-silent-sort</td>
+        <td>Boolean</td>
+        <td>true</td>
+        <td>Set <code>false</code> to sort the data silently. This options works when the sidePagination option is set to <code>server</code>.</td>
+    </tr>
+    <tr>
         <td>rowStyle</td>
         <td>data-row-style</td>
         <td>Function</td>

+ 2 - 1
src/bootstrap-table.js

@@ -288,6 +288,7 @@
         toolbarAlign: 'left',
         checkboxHeader: true,
         sortable: true,
+        silentSort: true,
         maintainSelected: false,
         searchTimeOut: 500,
         searchText: '',
@@ -878,7 +879,7 @@
         this.getCaret();
 
         if (this.options.sidePagination === 'server') {
-            this.initServer();
+            this.initServer(this.options.silentSort);
             return;
         }