62,046
社区成员
发帖
与我相关
我的任务
分享
//实体
public virtual int id { get; set; }
public virtual string text { get; set; }
public virtual bool leaf { get; set; }
public virtual string cls { get; set; }
public virtual IList<UnitType> children{get;set;}
public virtual bool Checked { get; set; }
public JsonResult showTree() {
IList<UnitType> types=GetTypes();
return Json(types, JsonRequestBehavior.AllowGet);
}
var store = Ext.create('Ext.data.TreeStore', {
proxy: {
type: 'ajax',
url: '<%= Url.Action("showTree", "Home")%>'//'/Data/check-nodes.json'
},
sorters: [{
property: 'leaf',
direction: 'ASC'
}, {
property: 'text',
direction: 'ASC'
}]
});
var tree = Ext.create('Ext.tree.Panel', {
store: store,
rootVisible: false,
useArrows: true,
frame: true,
title: 'Tree Panel',
renderTo: 'tree-div',
width: 289,
height: 220
});
});