treegrid easyui 二级子菜单 ajax特效

来源:互联网 发布:我的邻居是exo网络剧 编辑:程序博客网 时间:2024/05/17 02:18


<script>
$(function(){
$('#treegrid').treegrid({
title:'菜单管理',
iconCls:'icon-save',
nowrap: false,
rownumbers: true,
animate:true,
collapsible:false,
                    url:'default.aspx',
idField:'id',
treeField:'text',
toolbar:"#searchbox",
queryParams: { "action": "query" },
frozenColumns:[[
                       {  title:'id',field:'id',width:80,align:'center'

               }
]],
columns:[[
{field:'text',title:'名称',width:150},

{ title: '操作', field: 'id0',align:'center', width: 120, formatter: function (value, rec) {
                    return "<a   href=\"javascript:;\"  style=\"color:#000\">修改</a>";
                    }
                    }
]],
onBeforeExpand:function(row,param){

$(this).treegrid('options').url =  'default.aspx?bid='+row.id;


}
});
});


[
{
"id": 1350,
"pid": 1325,
"text": "综合演示",
"state": "closed",
"iconCls": "icon-book",
"url": ""
},
{
"id": 1327,
"pid": 1325,
"text": "表单组件",
"state": "closed",
"iconCls": "icon-layout_sidebar",
"url": ""
},
{
"id": 1328,
"pid": 1325,
"text": "表格组件",
"state": "closed",
"iconCls": "icon-database_table",
"url": ""
},
{
"id": 1329,
"pid": 1325,
"text": "菜单按钮",
"state": "closed",
"iconCls": "icon-piechart",
"url": ""
},
{
"id": 1330,
"pid": 1325,
"text": "图形报表",
"state": "closed",
"iconCls": "icon-chart_bar",
"url": ""
},
{
"id": 1331,
"pid": 1325,
"text": "扩展组件",
"state": "closed",
"iconCls": "icon-calendar",
"url": ""
}
]


[
{
"id": 1356,
"pid": 1350,
"state": "open",
"iconCls": "",
"text": "数据表格",
"url": "./html/complex/datagrid.html"
},
{
"id": 1357,
"pid": 1350,
"state": "open",
"iconCls": "",
"text": "树形表格",
"url": "./html/complex/treegrid.html"
},
{
"id": 1358,
"pid": 1350,
"state": "open",
"iconCls": "",
"text": "可编辑表格",
"url": "./html/complex/edatagrid.html"
},
{
"id": 1359,
"pid": 1350,
"state": "open",
"iconCls": "",
"text": "左右布局的双表",
"url": "./html/common/waiting.html"
},
{
"id": 1360,
"pid": 1350,
"state": "open",
"iconCls": "",
"text": "上下布局的双表",
"url": "./html/common/waiting.html"
},
{
"id": 1349,
"pid": 1350,
"state": "open",
"iconCls": "",
"text": "左上下布局的三表",
"url": "./html/common/waiting.html"
},
{
"id": 1361,
"pid": 1350,
"state": "open",
"iconCls": "",
"text": "左中右布局",
"url": "./topjui/image/icons/index.html"
}
]