-
Ext User
Stop event propagation on 'rowselect' event
Hello,
I'm using ExtJS 2.2. I have attached a handler to 'rowselect' event in a Grid. Also, I'm using another handler for 'click' event over all grid body:
grid.getView().mainBody.on({
'click':{ fn: this.onClick }
});
grid.getSelectionModel().on({
'rowselect': { fn: this.onRowSelect }
});
When I click in a row, first 'rowselect' event is fired, and then the 'click' one. But sometimes (depending of what part of the row body the user clicked) I want to stop event propagation on 'rowselect', so 'click' event isn't fired after 'rowselect' one. 'rowselect' handler didn't receive an EventObject as an argument, so I can't find a way to stop event propagation.
-
What are the parameters which are sent to your onRowSelect function?
-
Ext User
The arguments are (according to documentation and checked looking at 'arguments' inside the function):
selModel - The selection model
rowIndex - The selected row index
record - The selected record
-
Right. So that's no good. You don't get to see the event to cancel it.
What's the purpose here then? What's the click listener for if you want to cancel the event in the select listener?
-
Ext User
I'm developing a grid where you can 'expand' rows to display more info. So I expand the row on 'rowselect' event. Also, there is a small icon where you can click to expand/collapse the row too (like RowExpander plugin). I detect click on that icon using view's body 'click' event. This is a toggler: if row if expanded contract it, if it is contracted, expand it.
The problem is when user click on the icon of a unselected row. The 'rowselect' event fires and expand the row. Then, the 'click' event fires. And the row is already expanded so the click handler collapse the row.
I will try to use DelayedTask to accomplish that. But, IMHO, ExtJS should provide EventObject ALWAYS in all events handlers.
Anyway, thanks for your time
-
Sencha User
Hello,
I know this is old but, have you found a solution to the problem? I'm having the same problem here and it would be really helpful.
Thanks in advance,
Regards,
Jorge
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules