Hi,
Can someone tell me how to add a tooltip on each cell of all the rows of parent and child grids of webhierarchicaldatagrid on client-side. Currently I am using this function:
function initGrid(grid, args) { var rows = grid.get_rows(); var rowCount = rows.get_length(); var cellCount = rowCount > 0 ? rows.get_row(0).get_cellCount() : 0; for (var r = 0; r < rowCount; ++r) { var row = rows.get_row(r); for (var c = 0; c < cellCount; ++c) { var cell = row.get_cell(c); var cellEl = row.get_cell(c).get_element(); cellEl.title = "Message"; } } }
It adds the tooltip to parent rows but how to add the same message for all the child rows also.
Thanks,
Megha
Hello Megha,
Please refer to the below forum posts
http://news.infragistics.com/forums/p/48340/256954.aspx#256954
http://news.infragistics.com/forums/p/49969/263950.aspx#263950
In your scenario you should handle this event in WebHierarchicalDataGrid
Hope this helps.
Can you provide a code snippet on how to do it on the server side on IntializeRow event for both Parent rows and child rows.
Hi Megha,
You could handle the InitializeRow and set the Tooltip on the cells on the server side. If you want to do it client side that is fine, but you'll need to go through the child grids. Each row has row.get_rowIslands() which returns an array. Then you would need to get childGrid = row.get_rowIslands()[0] and do the same thing. If you know your levels, you could hard code it. If it is variable, I suggest turning this code into a recursive method where you pass in a grid to set tooltips for, then recursively call it with child grids.
regards,David Young
Thank you for posting in our forums.
It depends on if all your rows are initially loaded and expanded.
If this is the scenario you should iterate through all rows and their rowIslands.
Please refer to the below forum post for more information how to get the child rows
http://community.infragistics.com/forums/p/56036/305287.aspx#305287
If your parent rows are collapsed on initial loading, I recommend you handling RowExpanded client side event
<ClientEvents Initialize="whdg1_ContainerGrid_Initialize"
RowExpanded="whdg1_ContainerGrid_RowExpanded" />
function whdg1_ContainerGrid_RowExpanded(sender, eventArgs)
{
///<summary>
///
///</summary>
///<param name="sender" type="Infragistics.Web.UI.ContainerGrid"></param>
///<param name="eventArgs" type="Infragistics.Web.UI.ContainerGridRowEventArgs"></param>
//Add code to handle your event here.
var rows = eventArgs.get_row().get_rowIslands()[0].get_rows();
== THE SAME CODE SNIPPET ==
}
Let me know if you need further assistance