PDA

View Full Version : Can you identify the column that was clicked on



mickyw
26 Aug 2009, 3:34 PM
I'm using the Column Tree and need to know which column within the row the user clicks on. Is that possible?

CutterBl
26 Aug 2009, 6:20 PM
Have you dumped out (into Firebug) the 'arguments' sent to the click event?


listeners:{
click:{
fn: function(){
console.log(arguments);
},
scope: this
}

mickyw
27 Aug 2009, 7:02 AM
CutterBI,
I actually haven't dumped all the arguments, but I have taken a look at the node, and event objects. It seems very good at identifying the row, probably because extjs puts an id on that <div tag. But as near as I can tell:
A) the columns within the rows do not have any id's on them
B) the column isn't present in the node or event object

I have thought about just putting something like this the column that I want to identify:
<span id=mycolumn$rowid>img</span> and listening for a click on it, or puttting an onclick right in the code. I was trying to avoid all of that as I wasn't sure that extjs didn't have the ability to do that already.

CutterBl
27 Aug 2009, 7:06 AM
The reason I said 'dump the arguments' is to see exactly what that event is passing along. For instance, the RowSelection class of a Grid object, in it's click event, will pass the record, the column clicked, the row index, and a reference to the data store. Not knowing much about the ColumnTree (it's a user extension, right?) it's hard to tell.

mickyw
27 Aug 2009, 7:13 AM
CutterBI,
yeah, its a user extension, I think if I would have used something other than ColumnUI, like one of the grids, this would be a snap. BTW, the arguments have the node, the event, and a bunch of undefineds....So either I switch the UI Object I'm using, or I brute force it.


Thanks for the input,
M