ext desktop的递归生成
有如下结构:
var cAry = [{id:"test1",
text:"test1222",
title:"test1",
iconCls:"icon-webgis",
url:"http://www.msn.com",
menu:{
items:[{
id:"test-sub1",
text: "test-sub1",
iconCls:'icon-grid',
handler : this.createWindow,
menu:{
items:[{
id:"test-sub1",
text: "test-sub1",
iconCls:'icon-grid',
handler : this.createWindow,
scope: this,
url:"http://www.g.cn",
windowId: ++this.winIndex
},{
id:"test-sub2",
text: "test-sub12",
iconCls:'icon-grid',
handler : this.createWindow,
scope: this,
url:"http://www.bing.com",
windowId: ++this.winIndex
}]
},
scope: this,
url:"http://www.g.cn",
windowId: ++this.winIndex
},{
id:"test-sub2",
text: "test-sub12",
iconCls:'icon-grid',
handler : this.createWindow,
scope: this,
url:"http://www.bing.com",
windowId: ++this.winIndex
}]
}
},{
id:"test-main2",
text: "test-main2",
iconCls:'icon-grid',
handler : this.createWindow,
scope: this,
url:"http://www.bing.com",
windowId: ++this.winIndex
}];
要想动态的生成desktop的动态菜单,我想问一下应该如何写js函数,我希望使用动态的构建,希望使用for循环来完成对cArg数据的解析