extjs 4 treepanel locked and expand

extjs 4 treepanel locked and expand

精选 转载

arkshine 博主文章分类:extjs4

文章标签 extjs lock tree 文章分类 前端开发

http://www.sencha.com/forum/showthread.php?136118-Locked-columns-on-a-tree-panel 

 

Locked columns on a tree panel

 

Hi,

If you take the treegrid example (ext/examples/tree/treegrid.js) and tell the first column to be locked, the sample no longer loads with the following error.

Uncaught TypeError: Cannot call method 'setRootNode' of undefined ext-all-debug.js:88047

Code:
columns: [{
       xtype: 'treecolumn', //this is so we know which column will show the tree
       text: 'Task',
       width: 150,
       sortable: true,
       dataIndex: 'task',
       locked:true
},{

Any ideas?

Thanks

It's not prepared to work with locked yet. Try this but don't trust it extjs 4 treepanel locked and expand_extjs lock tree

Code:
Ext.tree.Panel.override({
    isContainerPanel : function() {
        return !this.items || !!this.child('treepanel');
    },

    onRootChange: function(root) {
        if (!this.isContainerPanel()) {
            this.callOverridden(arguments);
        }
    },

    constructor: function(config) {
        config = config || {};
        
        this.enableAnimations = false;  // PATCH
        delete config.animate;
        
        this.callParent([config]);

        this.onRootChange(this.store.getRootNode());// PATCH
    }
});
  • 收藏
  • 评论
  • 举报
提问和评论都可以,用心的回复会被更多人看到 评论
发布评论
相关文章

举报文章

请选择举报类型

内容侵权 涉嫌营销 内容抄袭 违法信息 其他

具体原因

包含不真实信息 涉及个人隐私

补充说明

0/200

上传截图

格式支持JPEG/PNG/JPG,图片不超过1.9M

已经收到您得举报信息,我们会尽快审核