Grid Header Element

5 views
Skip to first unread message

JoeChev

unread,
Dec 14, 2009, 12:19:58 PM12/14/09
to completeui
In trying to get the column header element I'm having some issues.
What I want to do is set a behavior for when the user's mouse moves
over a column header. Can you provide an example of how to do this?

In an unrelated question - is it possible to have a cell enter/leave
edit mode when a user mouses over/out of that particular cell?

timkim

unread,
Dec 14, 2009, 5:24:15 PM12/14/09
to completeui
Hi Joe,

You could make your own events for the mouse over on a column header
element, but you would have to override some existing functionality
(i.e., header hover state). But if you still want to override it, use
this function definition:
nitobi.grid.Grid.prototype.handleHeaderMouseOut = function(event){//
algorithms!}

It is possible for a cell to enter/leave edit mode, so it'll look
something like: <ntb:grid onmouseoverevent="myFunction(e)">

And here's a half pseudo code snippet that should help:
myFunction(e)
{
var myGrid = nitobi.getComponent('theGridId');

// clear out the last cell edit
myGrid.setEditMode(false);

// get cellObject from event arg e
// set cell to edit mode
// cellObjectReference.edit();
}

I hope that helps!

JoeChev

unread,
Dec 16, 2009, 10:08:14 AM12/16/09
to completeui
The event args from a mouse over event seem to be undefined. Isn't
that mouse over event fired when the mouse is placed over any portion
of the grid? I guess I'm having difficulty figuring out how to only
take action when the mouse is over a cell, and how to get the cell
from the event arg.
Reply all
Reply to author
Forward
0 new messages