View Full Version : Row/Column mouseover
how do I catch mouseover event on Grid cell or row?
Where do I add the listener? I tried adding a listener to ColumnConfig to handle Events.OnMouseOver, but it never fires.
Add the listener to the Grid directly
Added to grid directly, but although I get a GridEvent onMouseOver, event.getRowIndex() always return -1 or 0. I suspect because there is no selection?
What I need is DataModel for the row or column that was moused over. What I ended up doing is using GridCellRenderer to render a LayoutContainer, then add onMouseOver listener to the panel in order to retrieve data onmouseover. not desirable solution IMO since every column then would need the same design pattern for row mouseover to work.
Adding this to the "Basic Grid" example works like a charm:
grid.addListener(Events.OnMouseOver, new Listener<GridEvent<Stock>>(){
public void handleEvent(GridEvent<Stock> be) {
System.out.println(be.getRowIndex());
}
});
Ok thanks.
I will have to debug my grid to see why it always returns 0 onMouseOver.
pulkitagarwal
7 Jan 2011, 5:49 AM
TrackMouseOver in Grid ,
rowOverCls in Grid View ,
This will change the row css on hover
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.