EXTJS4.0 treepanel 用法笔记~~创建简单的tree

来源:互联网 发布:windows xp镜像文件 编辑:程序博客网 时间:2024/05/16 15:14

var store = Ext.create('Ext.data.TreeStore', {
    proxy : {
        type : 'ajax',
        url : 'createtree.action'
    }
    ,
    listeners:{
        'load':function(treestore,node,record,su){
        if(su){
         
    }
}
}
});
var tree = Ext.create('Ext.tree.Panel', {
    region : 'west',
    store : store,
    rootVisible : false,
    root : true,
    useArrows : true,
    frame : true,
    split : true,                  //分割线
    width : 200
});
tree.addListener('itemclick', click, this);
var cellid, celldescr;
function click(view, record, item, index, e) {
    celldescr = record.raw.text;
    cellid = record.raw.id;  
}