浏览代码

Update test.html

zhixin 11 年之前
父节点
当前提交
973e666880
共有 1 个文件被更改,包括 15 次插入2 次删除
  1. 15 2
      docs/test.html

+ 15 - 2
docs/test.html

@@ -19,13 +19,15 @@
     </div>
     </div>
     <table id="table"
     <table id="table"
            data-toggle="table"
            data-toggle="table"
-           data-url="data1.json"
+           data-url="/examples/bootstrap_table/data"
            data-show-columns="true"
            data-show-columns="true"
            data-search="true"
            data-search="true"
            data-show-refresh="true"
            data-show-refresh="true"
            data-show-toggle="true"
            data-show-toggle="true"
            data-pagination="true"
            data-pagination="true"
-           data-height="500">
+           data-height="500"
+           data-side-pagination="server"
+           data-query-params="queryParams">
         <thead>
         <thead>
         <tr>
         <tr>
             <th data-field="name">Item Name</th>
             <th data-field="name">Item Name</th>
@@ -73,6 +75,17 @@
             data: data
             data: data
         });
         });
     }
     }
+
+    // url: /examples/bootstrap_table/data?offset=0&limit=10&search=test
+    function queryParams(params) {
+        return {
+            limit: params.pageSize,
+            offset: params.pageSize * (params.pageNumber - 1),
+            search: params.searchText,
+            name: params.sortName,
+            order: params.sortOrder
+        };
+    }
 </script>
 </script>
 </body>
 </body>
 </html>
 </html>