PDA

View Full Version : problem with mouse event on grid


goldz
09-25-2005, 07:21 PM
good day!

i have another problem concerning grids...

i need to drag-and-drop from a <grid> whatever are selected on it (multiselect = true) but there doesn't seem to be an 'onmouseover' or 'onmouseout' or even an 'ondbclick' event on the grid. nothing is displayed on the debugger when i added ondbclick="debug.write('clicked')" on the grid's tag. same thing happens for the <gridcolumn> and <gridtext>.

i tried to detect these events on the <text>s inside the <gridcolumn>, that is,

<gridcolumn>
<text onclick="debug.write('clicked')">
Text
</text>
</gridcolumn>

but what happens is that 'clicked' is displayed on the debugger but i can no longer select anything on the grid.

can anybody please help? i would really appreciate it. :D

goldz
10-10-2005, 03:47 AM
Hello!

I found another solution to this double-click problem and thought some of u might be interested or have some comments :D

What I did is I extended the <basegridrow> class, since it is the rows that are actually double-clicked and not the grid itself, and place these rows on the grid. When double-clicked, these rows the call their ownerGrid to trigger its own double-click event.

<class name="mygridrow" extends="basegridrow">
<method event="ondblclick">
if(typeof ownerGrid.dodblclick != 'undefined')
ownerGrid.dodblclick();
</method>
</class>

<class name="mygrid" extends="grid" _rowclass="mygridrow">
<attribute name="ondblclick" value="null"/>
<method name="dodblclick">
if(this.ondblclick)
this.ondblclick.sendEvent();
</method>
</class>


The key here is the _rowclass which is a protected attribute of the grid. I had to do some digging before I saw this attribute since it's not documented. One can also add more event on the gridrow, I think...

I've already tried this and it works fine. I hope it works well with you guys, too. (^o^)v

bfagan
10-10-2005, 10:00 AM
Have you tried the "onselect" event?

bytebodger
06-22-2006, 03:29 PM
I just tried this with for the onmouseover event and it worked like a charm! I want to have a pop-up menu display everytime a user mouses over a row in a grid and this does the trick.

THANKS!!!