12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- /*
- * 返回json格式中 最好默认带有ID列
- 默认显示 20列
- * 列表id = 'gridTable'
- 列表url = 'Handler.ashx?action=page'
- 列表datatype = 'json'
- 列表colNames = ['ID', '名称', '性别', '手机', '邮箱']
- 列表colModel = 。。。
- 列表标题 caption = '用户列表'
- 列表修改URL editurl = 'Handler.ashx?action=oper'
- 列表默认排序 sortname = 'ID';
- 页码ID gridPagerID = 'gridPager'
- */
- //最后选中的行
- var lastsel;
- function myJqTreeGrid(id, url, datatype, colNames, colModel, caption,
-
- name, gridPagerID,sortorder,height,width,
- multiselect,rownumbers) {
- var myGrid = $('#' + id);
- myGrid.jqGrid({
- treeGrid: true,
- treeGridModel: 'adjacency', //treeGrid模式,跟json元数据有关 nested adjacency ,
- ExpandColumn :name,
- url: url,
- loadtext:"读取数据中。。。",
- datastr: 'data.json',
- datatype: datatype,
- height:height,
- width:width,
- rowNum: -1,
- rowList: [10, 20, 50],
- colNames: colNames,
- colModel: colModel,
- treeReader : {
- loaded: "loaded",
- level_field: "levels",
- parent_id_field: "parent",
- leaf_field: "isleaf",
- expanded_field: "expanded"
- },
- mtype: "POST"
- });
- }
|