覆写了 $.fn.datagrid.defaults.
| 参数名 | 类型 | 描述 | 默认值 |
| title | string | Datagrid面板的标题 | null |
| iconCls | string | 在面板上通过一个CSS类显示16x16图标。 | null |
| border | boolean | 设置面板是否具有边框 | TRUE |
| width | number | datagrid面板的宽度 | auto |
| height | number | datagrid面板的高度 | auto |
| columns | array | DataGrid列配置对象 | null |
| frozenColumns | array | 冻结的列,被现实在左边 | null |
| striped | boolean | 设置是否让单元格显示条纹。默认false。 | FALSE |
| method | string | 通过该方法类型请求远程数据。默认post。 | post |
| nowrap | boolean | 是否包裹数据,默认为包裹数据显示在一行 | TRUE |
| idField | string | 标识字段,或者说主键字段 | null |
| url | string | 请求数据的URL. | null |
| loadMsg | string | 加载数据时显示的信息 | Processing, please wait … |
| pagination | boolean | 是否显示分页工具栏 | FALSE |
| rownumbers | boolean |
columns:[[
{field:‘itemid‘,title:‘Item ID‘,rowspan:2,width:80,sortable:true},
{field:‘productid‘,title:‘Product ID‘,rowspan:2,width:80,sortable:true},
{title:‘Item Details‘,colspan:4}
],[
{field:‘listprice‘,title:‘List Price‘,width:80,align:‘right‘,sortable:true},
{field:‘unitcost‘,title:‘Unit Cost‘,width:80,align:‘right‘,sortable:true},
{field:‘attr1‘,title:‘Attribute‘,width:100},
{field:‘status‘,title:‘Status‘,width:60}
]]
|
|
| Name | Parameter | Description |
|---|---|---|
| options | none | 返回所有属性 |
| resize | none | 重置大小布局 |
| reload | none | 重新加载数据 |
| fixColumnSize | none | 调整列的大小 |
| loadData | param | 装载数据,以前的数据会被移除 |
| getSelected | none | 返回选中的行,没有则返回空 |
| getSelections | none | 返回所有的行,空则返回空数组 |
| clearSelections | none | 取消所有选中 |
| selectRow | index | 选中一行,参数为行号 |
| selectRecord | idValue | 根据主键查询出一条记录 |
| unselectRow | index | 取消选中一行 |
EasyUI 之datagrid 使用 【DataGrid属性解释】
原文:http://www.cnblogs.com/sandyliu1999/p/4973663.html