日期:2014-05-16 浏览次数:20301 次
Ext.define('TopMenu', {
extend: 'Ext.data.Model',
fields: [
{ name: 'name', type: 'string' }
],
proxy: {
type: 'ajax',
url: 'http://localhost:3075/AjaxServices/MenuQuery',
reader: {
type: 'json',
root: 'children'
}
}
});
var menuStore = Ext.create('Ext.data.TreeStore', {
model: "TopMenu",
root: {
expanded: true
}
});
Ext.create('Ext.tree.Panel', {
renderTo: "left",
width: 170,
height: 500,
store: menuStore,
rootVisible: false,
columns: [
{ xtype: 'treecolumn', header: '目录', dataIndex: 'name', flex: 1 }
],
listeners: {
'itemclick': function (view, record) {
switch (record.data.name) {
case "浏览量统计":
window.location.href = "general.html";
break;
default :