PDA

View Full Version : Problems Trying To Edit Tree Panel ExtJS 4



jeromer
16 Aug 2011, 10:03 AM
I'm using the attached code to edit a treepanel. If I use configuration of clicksToEdit:2, it works fine on the leaf nodes but not on a branch node. If I use configuration of clicksToEdit:1, it works on both nodes. Of course I want 2 clicks. Anyone had this problem?


var store = Ext.create('Ext.data.TreeStore',{
//autoLoad:true,
model:'CP.model.ProductGroupsModel' /*,
root:{ text: "Complaint Product Groups",
expanded:true,
leaf:false
}*/
}
);


Ext.override(Ext.data.AbstractStore,{
indexOf: Ext.emptyFn
});




Ext.define('CP.view.productGroup.PGView' ,
{
extend: 'Ext.tree.Panel',
alias : 'widget.pgTree',
title : 'All Complaint Product Groups',
autoScroll: true,
useArrows:true,
viewConfig:{plugins:{ptype:'treeviewdragdrop'}},
store:store,
rootVisible:false,
fbar:
[


{xtype:'button',text:'Save' },
{xtype:'component',flex:1}
],
selType: 'cellmodel',
plugins: [
Ext.create('Ext.grid.plugin.CellEditing', {clicksToEdit:2})
],
columns:[{xtype:'treecolumn',text:'Product Group / Parts',dataIndex:'text',flex:1,sortable:true,editor:{xtype:'textfield',allowBlank:false}},{text:'Description',dataIndex:'description',flex:2,sortable:false}]

}
);

skirtle
16 Aug 2011, 4:14 PM
Try adding toggleOnDblClick: false to your viewConfig.

jeromer
17 Aug 2011, 10:12 AM
This WORKED!!!....thanks..BUT, where/how did you find the toggleOnDblClick config opt for the viewConfig. I sure would like to know how to find some of this good stuff.

skirtle
17 Aug 2011, 2:32 PM
I just looked at the source code. Had a search through the relevant source files for 'dblclick' and struck lucky. I was expecting to have to override a method but someone was forward-thinking enough to provide a setting.

ferengidedalo
24 Aug 2012, 4:51 PM
how do you edit the NODE itself... not another column?

thanks!

manojmoktan
17 Feb 2014, 10:35 PM
Hi jeromar,would you plz post any link that you have successly editing tree panel. i couldn't solve of edit on tree panel node and their leaf.Thanks in Adavance