Extend from $.fn.panel.defaults. Override defaults with $.fn.datagrid.defaults.The datagrid displays data in a tabular format and offers ric ...
Extend from $.fn.panel.defaults. Override defaults with $.fn.datagrid.defaults.
The datagrid displays data in a tabular format and offers rich support to select, sort, group and edit data. The datagrid has been designed to reduce development time and to require no specific knowledge from developers. It is both featherweight and feature-rich. Cell merging, multi-column headers, frozen columns and footers are just a few of its features.
依赖
- panel
- resizable
- linkbutton
- pagination
用法示例
Create datagrid from an existing table element, defining columns, rows, and data in html.
- <table >
- <thead>
- <tr>
- <th data-options="field:'code'">Code</th
- <th data-options="field:'name'">Name</th
- <th data-options="field:'price'">Price</th
- </tr
- </thead
- <tbody>
- <tr>
- <td>001</td<td>name1</td<td>2323</td
- </tr
- <tr>
- <td>002</td<td>name2</td<td>4612</td
- </tr
- </tbody
- </table
Create datagrid via <table> markup. The nested <th> tags define the columns on the table.
- <table
- data-options="url:'datagrid_data.json',fitColumns:true,singleSelect:true">
- <thead>
- <tr>
- <th data-options="field:'code',width:100">Code</th
- <th data-options="field:'name',width:100">Name</th
- <th data-options="field:'price',width:100,align:'right'">Price</th
- </tr
- </thead
- </table
Create datagrid using javascript is also allowed.
- <table id="dg"></table
- $('#dg').datagrid({
- url:'datagrid_data.json',
- columns:[[
- {field:'code',title:'Code',width:100},
- {field:'name',title:'Name',width:100},
- {field:'price',title:'Price',width:100,align:'right'}
- ]]
- });
Query data with some parameters.
- $('#dg').datagrid('load', {
- name: 'easyui',
- address: 'ho'
- });
After changing data to server, refresh the front data.
- $('#dg').datagrid('reload'); // reload the current page data
表格属性
The properties extend from panel. below is the added properties for datagrid.
名称 | 类型 | 描述 | 默认值 |
---|
columns | array | The datagrid columns config object, see column properties for more details. | undefined |
frozenColumns | array | Same as the columns property, but the these columns will be frozen on left. | undefined |
fitColumns | boolean | True to auto expand/contract the size of the columns to fit the grid width and prevent horizontal scrolling. | false |
resizeHandle | string | Resizing column position, Available value are: 'left','right','both'. When 'right', users can resize columns by dragging the right edge of column headers, etc.
海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com
原标题:JQuery Easy Ui DataGrid
关键词:jquery
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。
|