I am trying to use the iggridtooltipstooltipshowing event on an igTreeGrid to intercept the tooltip and customize it, however I am finding that the property that the documentation claims to contain the row number is always undefined.
Given the following...
$(document).delegate("#grid2", "iggridtooltipstooltipshowing", function (evt, ui) {
var columnIndex = ui.columnIndex;
var columnKey = ui.columnKey;
var tooptipElement = ui.element;
var rowIndex = ui.index;
var tooltipText = ui.tooltip;
ui.tooltip = "Bla Bla";
});ui.index is always undefined. Can anyone tell me why this property is always undefined? I need to know the row number so that I can look up a value specific to the row/cell where the tooltip is showing.
Hello Mike,
Thank you for posting in our community.
I tested you scenario and I was not able to reproduce the described behavior. On my side the event is fired and the row index was returned correctly.
I am attaching the sample project that I used to test this for your reference. In my sample I am handling tooltip showing event of the grid and I am showing an alert with the id of the row that fired the event. For example:
$(document).delegate("#grid", "iggridtooltipstooltipshowing", function (evt, args) { alert("Event was fired from row: " + args.index ); });
$(document).delegate("#grid", "iggridtooltipstooltipshowing", function (evt, args) {
alert("Event was fired from row: " + args.index );
});
Please test this sample and let me know what is the result on your side. Whether or not it works correctly on your side may help indicate the nature or your issue.
If this is not an accurate demonstration of what you are trying to achieve please feel free to modify it and send it back or send me an isolated, ready to run sample wheteh this issue is reproducible.
Looking forward to hearing from you.
I was able to get the example working and I also was able to modify it to produce the problem I am having. As I mentioned in the original post I am using igTreeGrid, not igGrid. Please see the attached example where the problem can be reproduced.
I understand that igTreeGrid is CTP. Since tool tips were existing behaviors in igGrid and igTreeGrid implements the behaviors of igGrid, it seems silly to me that they would be broken in igTreeGrid when they work in igGrid.
When is 15.1 going to be released? Would it be possible to identify the fix and apply it to my existing 14.2 file for the igTreeGrid?
Most of the igTreeGrid functionalities have undergone some major changes for the RTM version that is going to be available in 15.1 in April this year.
What I can suggest as an alternative approach for version 14.2 is getting the cell element from the event arguments and retrieve its index. Please keep in mind that there are two possible options for the index:
1) To retrieve the index of the row form all rendered rows. This means that even if some rows are rendered however collapsed they will be also taken under consideration.
2) To retrieve the index of the row only from the visible rows.
For example:
. . { name: "Tooltips", visibility: "always", tooltipShowing: function (evt, args) { var $tr = $(args.element).closest('tr'), //this the row index of all render rows. Keep in mind that some rows might be render, however not visible if they are collapsed indexRow = $tr.index(), //this is the row index from the visible rows visibleIndexRow = $tr.closest('tbody').children('tr:visible').index($tr); alert(indexRow + ' - visibleIndexRow: ' + visibleIndexRow); } } ..
.
{
name: "Tooltips",
visibility: "always",
tooltipShowing: function (evt, args) {
var $tr = $(args.element).closest('tr'),
//this the row index of all render rows. Keep in mind that some rows might be render, however not visible if they are collapsed
indexRow = $tr.index(),
//this is the row index from the visible rows
visibleIndexRow = $tr.closest('tbody').children('tr:visible').index($tr);
alert(indexRow + ' - visibleIndexRow: ' + visibleIndexRow);
}
..
I also made a small sample illustrating my suggestion which could be found at the following link:
http://jsfiddle.net/018h61or/
I hope you find my suggestion helpful.
Please let me know if you need any further assistance with this matter.
I plan on trying the proposed workaround , I just have not made it there yet. I will update this posting when I have a result. Thanks.
Thank you for getting back to me.
Please let me know if you have any additional questions regarding this matter after implementing my suggestion.