Handling itemclick event on tree panel Extjs 4

前端 未结 3 1850
猫巷女王i
猫巷女王i 2020-12-29 14:55

what I am trying to do is to get different reaction on a different tree LEAF click!

var myTree = Ext.create(\'Ext.tree.Panel\',
    store: store,
    rootVis         


        
3条回答
  •  独厮守ぢ
    2020-12-29 15:27

    I was trying to do a generic treepanel's item click handler and to be able to get a custom field I added to the node object. This helped me out. I dunno if this is the standard and compatible ExtJs 4 way:

                (Some Panels Here),
                items: [{
                    xtype: 'treepanel',
                    listeners: {
                        itemclick: {
    
                            fn: function (view, record, item, index, e) {
    
                                console.log(record.raw.userData);
                            }
                (removed...)
    

提交回复
热议问题