jQWidgets Forums
jQuery UI Widgets › Forums › Grid › cellHover fires for every column in row?
This topic contains 6 replies, has 2 voices, and was last updated by jerrade 9 years ago.
-
Author
-
I have a function assigned to the cellhover property of my grid. When I hover over a cell, the function is called multiple times, apparently once for every column in the grid. Is this because the selectionmode is “singlerow”? When I hover over a cell, the entire row is highlighted, but that doesn’t mean that every cell should be considered hovered over. I can’t think of a scenario where that behavior would be useful. In addition, the cellhover function isn’t called when hovering over different cells in the same row. It’s only called when a different row is hovered over. Is this by design, or am I doing something wrong? Thanks.
Here’s an example of the problem: http://jsfiddle.net/jerrade/cgtdzuya/1/
What I’m trying to accomplish is to display a jqxTooltip for a particular column. It would work if cellhover wasn’t acting so strange.Hi jerrade,
Yes, this is default behavior.
Please useselectionmode: 'singlecell',
if you want only one call of your function.Best Regards,
Ivailo IvanovjQWidgets Team
http://www.jqwidgets.comCan you describe a scenario in which this would be desired behavior? Why would you ever want the cellhover function to fire for a bunch of cells that were not hovered over?
selectionmode: 'singlecell'
works for my tooltip purpose, but it isn’t ideal because I don’t really want individual cells to be selectable. Frankly, I’m not sure why “selection” and “hover” aren’t two completely separate concepts.Hi jerrade,
In row selection mode, all cells are hovered when you hover the row.
That’s the reason cellhover is raised for each cell.Best Regards,
Ivailo IvanovjQWidgets Team
http://www.jqwidgets.comI understand that. I just don’t understand why anyone would ever want that. It sounds like a bug to me. To me, “hover” is a mouse-related concept, not a display concept. Just because the entire row is highlighted (which is a display concept), doesn’t mean that every cell in the row is hovered over. I think a separate rowhover event would make more sense, inside which you could iterate over the columns if you wanted to access them for whatever reason.
I’m not trying to be difficult or beat a dead horse here, but if you have
cellhover: function(tableCell, x, y) { var cell = $('#jqxgrid').jqxGrid('getcellatposition', x, y); console.log(tableCell); console.log(cell.column + ' x:' + x + ', y:' + y); }
, this gets called for each cell in the row. The
cell.column
,x
, andy
values are the same for each call (the actual cell that is hovered over), but tableCell is different for each call. How does that make sense? -
AuthorPosts
You must be logged in to reply to this topic.