-
29 Nov 2011 4:24 PM #1Sencha User
- Join Date
- Nov 2010
- Location
- Villaflores,Chiapas,Mexico
- Posts
- 52
- Vote Rating
- 0
- Answers
- 4
Unanswered: Treepanel Listener event does not works ExtJs 4.0.7
Unanswered: Treepanel Listener event does not works ExtJs 4.0.7
Hi All, i need to fire a event in my treepanel node , but anything happens,i'm using this code:
listeners:{
itemclick:{
fn: function(){
Ext.Msg.alert('ExtJs is So Cool');
}
},
check this out, the rest of my code:
What is going on¿ thanks.HTML Code:items: [ { xtype: 'treepanel', title: 'Catalogos', height: 212, iconCls:'catalogos', forceLayout: true, collapsed: true, collapsible: true, rootVisible: false, border: false, autoWidth: true, root: { text: '', isTarget: false, expanded: true, checked: false, allowDrag: false, allowDrop: false, editable: false, qtip: 1, children: [ { text: 'Regiones', children: [ { text: 'Estados111', leaf: true, listeners:{ itemclick:{ fn: function(){ Ext.Msg.alert('ExtJs is So Cool'); } }, } }, { text: 'Municipios', leaf: true } ] },
-
30 Nov 2011 11:40 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,107
- Vote Rating
- 453
- Answers
- 3157
You should put the itemclick listener on the tree panel itself.
Also, please post threads in the appropriate forum. I have moved this one.Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
30 Nov 2011 12:07 PM #3Sencha User
- Join Date
- Nov 2010
- Location
- Villaflores,Chiapas,Mexico
- Posts
- 52
- Vote Rating
- 0
- Answers
- 4
Tnaks but where? or how?
Tnaks but where? or how?
Ok Thanks but, in what part of my code? in ExtJs 3.3.x i've put my Listener event in the same place of my piece of code and works perfect, but in my ExtJs 4.0 example code where?
-
30 Nov 2011 12:14 PM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,107
- Vote Rating
- 453
- Answers
- 3157
I said on the tree panel itself. So in the same level as the xtype : 'treepanel'
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
30 Nov 2011 1:32 PM #5Sencha User
- Join Date
- Nov 2010
- Location
- Villaflores,Chiapas,Mexico
- Posts
- 52
- Vote Rating
- 0
- Answers
- 4
Ok Thanks, I saw much change, ExtJs ExtJS 3.x and 4.x, here is my code and resolved: items: [ { xtype: 'treepanel', title: 'Catalogos', height: 212, iconCls:'catalogos', forceLayout: true, collapsed: true, collapsible: true, rootVisible: false, border: false, autoWidth: true, listeners:{//Listeners apuntando a cada node itemclick:function(view, record, item, index, e) { if (index==1) { addTab(); } if (index==2) { Ext.Msg.alert('Title','Indice 2'); } } }, bla. bla. bla
-
30 Nov 2011 1:36 PM #6Sencha User
- Join Date
- Nov 2010
- Location
- Villaflores,Chiapas,Mexico
- Posts
- 52
- Vote Rating
- 0
- Answers
- 4
Thanks
Thanks
Ok Thanks, I saw much change, ExtJs ExtJS 3.x and 4.x, here is my code and resolved:
HTML Code:items: [ { xtype: 'treepanel', title: 'Catalogos', height: 212, iconCls:'catalogos', forceLayout: true, collapsed: true, collapsible: true, rootVisible: false, border: false, autoWidth: true, listeners:{//Listeners apuntando a cada node itemclick:function(view, record, item, index, e) { if (index==1) { addTab(); } if (index==2) { Ext.Msg.alert('Title','Indice 2'); } if (index==4) { Ext.Msg.alert('Title','Indice 4'); } } }, root: { text: '', isTarget: false, expanded: true, checked: false, allowDrag: false, allowDrop: false, editable: false, qtip: 1, children: [ { text: 'Regiones', children: [ { id:'IdEstados', text: 'Estados', leaf: true, }, { text: 'Municipios', leaf: true } ] }, { text: 'Usuarios', children: [ { el:'IdUsuarios', text: 'Tree Node', leaf: true } ] }, { text: 'Solicitantes', children: [ { id:'Listado', text: 'Listado', leaf: true } ] } ] },


Reply With Quote