-
28 Jul 2010 1:31 AM #1
cannot fire a "click" event in a tree
cannot fire a "click" event in a tree
Hi,
I have a treepanel in my left panel :
Code:title: 'navigation', region:'west', width: 175, minSize: 100, maxSize: 250, layout: 'accordion', items:[ { title: 'etudes', iconCls: 'studiesIcon', items: [new Tree.TreePanel({ id: 'metadataTreeView', useArrows: true, autoScroll: false, animate: true, enableDD: true, border: false, dataUrl: './getStudyList.htm?targetDivId=metadataContent', root: { nodeType: 'async', text: 'etudes', draggable: false, id: 'studyRoot', cls: 'metadataTreeViewClass', expand: true, subEntityName: 'Study', create: true, allowedActions: {} }, listeners: { click: function(node) { selectedMetadataNode = node; alert('ca passe 2') updateActionsAvailability(.....); doClickAction(....); }, contextmenu: function(node){ selectedMetadataNode = node; updateActionsAvailability(....); } }
in my center panel, I try to fire the event "click" of my treeview :
In case of success in the function "doSubmitAction" and in the case (ArgAction == 'insert') I print "ca passe1" correctly but afterwards it doesn't want to execute neither "nodeToClick.select();" nor "var test = tree.fireEvent("click",nodeToClick);"Code:function doSubmitAction(form, gridsToUpdate, actionUrl, postAction, waitingMessage, failureMessage, successMessage, statusBar, tree, mode, module, ArgAction, node){ form.submit({ url:actionUrl, waitMsg: waitingMessage, success: function(form, action){ var resultingId = action.response.responseXML.childNodes[0].childNodes[3].textContent; tree.reloadAndApplyState(); if (ArgAction == 'insert') { var nodeToClick = tree.getNodeById(node.attributes['subPath']+resultingId); alert('ca passe1 node.attributes-subPath-resultingId='+node.attributes['subPath']+resultingId); /*nodeToClick.select(); alert('ca passe 10'); */ var test = tree.fireEvent("click",nodeToClick); alert('ca passe 11 firevent='+test); } else { ...... } }, failure: function (result, request) { updateStatusBar(...); Ext.Msg.alert(...); } }) }
Does anybody has an idea ? Thanks in advance
-
29 Jul 2010 7:08 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,167
- Vote Rating
- 29
why try to synthesize a click event? Why not just select the node!?

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
29 Jul 2010 7:20 AM #3
I thought that, but then I thought maybe there will be an unknown, arbitrary number of listeners which will still need to know.
Firing an event should work. The OP just needs to get his act together and debug it. Step into the fireEvent call and find out why it's not doing what he hoped it would.
It's what we all have to do when just staring at the code fails!Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
29 Jul 2010 7:27 AM #4Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,167
- Vote Rating
- 29
I doubt the OP is aware on how to debug
.
He's using alerts.
Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
29 Jul 2010 7:29 AM #5
Then his project will overrun, and might even fail.
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
29 Jul 2010 7:30 AM #6Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,167
- Vote Rating
- 29
I couldn't imagine a life w/out at least firebug


Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
Similar Threads
-
[FIXED-210][Ext 3.0.1] RowSelectionModel "rowselect" event fire for cells in same row
By paulcrowder in forum Ext 3.x: BugsReplies: 1Last Post: 31 Aug 2009, 6:04 PM -
Now "right-click" or "contextmenu" event on Button?
By dbassett74 in forum Ext 3.x: Help & DiscussionReplies: 1Last Post: 11 Jul 2009, 10:19 AM -
Fire a Tree "SelectionChange" event when clicking the currently selected item
By Cputerace in forum Ext GWT: Help & Discussion (1.x)Replies: 0Last Post: 27 Feb 2009, 8:59 AM -
[2.1][FIXED] Store.loadData does not fire "load" event
By mcurrey in forum Ext 2.x: BugsReplies: 4Last Post: 22 Jul 2008, 11:25 AM -
Ext.data.HttpProxy does not fire the "load" event.
By Animal in forum Ext 1.x: BugsReplies: 1Last Post: 12 Apr 2007, 4:00 AM


Reply With Quote