Need some information on how to retrieve row data from a hieracal grid (client side). Each row in the grid contains a checkbox. Whenever a checkbox is modified, I need to retrieve the checked/unchecked status and the Parent and child ID's.
Currently have an onclick event for the checkbox. this allows me to retrieve the state of the checkbox,but I'm unable to get any additional information from the row the checkbox is located.
Also attempted to retrieve the information using the RowClicked event. and using the get_itemIndexHierarchal() function. It only works for the top level item and throws an error for the rest.
Any help on retrieving data (client side) from a Hierarchal grid will be appreciated.
Thanks
Jacques
Currently have an onclick event for the checkbox. this allows me to retrieve the state of the checkbox,but I'm unable to get any additional information from the row the checkbox is located.
Also attempted to retrieve the information using the RowClicked event. and using the get_itemIndexHierarchal() function. It only works for the top level item and throws an error for the rest.
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"> |
<script type="text/javascript"> |
//Process the click event of a checkbox. When a parent is checked all children should be checked |
//When a parent is unchecked, no action need be taken. |
//When a child is unchecked, the parent must be unchecked |
function processAccessCheckBox(item) { |
var grid = $find("<%= rgPermission.ClientID %>"); |
var gridgridSelectedItems = grid.get_masterTableView().get_selectedItems(); |
alert(gridSelectedItems.count); |
//get all detail tables in the hierarchy |
var detailTablesArray = grid.get_detailTables(); |
if (item.checked) { |
alert(item.checked); |
//var ParentID = detailTablesArray[0]. |
//Check all child items |
//Check if detail table is a child |
} |
else { |
alert(item.checked); |
//Uncheck parent item |
//var parentRow = get_parentView |
} |
alert(detailTablesArray.length); |
return false; |
} |
function RowClick(sender, eventArgs) { |
var MTV = eventArgs.get_tableView(); |
var cbCol = MTV.getCellByColumnUniqueName(MTV.get_dataItems()[eventArgs.get_itemIndexHierarchical()], "Access"); |
var text = ""; |
text += "col content: "; |
text += cbCol.innerHTML |
//text += ", Index: " + eventArgs.get_itemIndexHierarchical(); |
//document.getElementById("OutPut").innerHTML = text; |
alert(text); |
} |
</script> |
</telerik:RadScriptBlock> |
Any help on retrieving data (client side) from a Hierarchal grid will be appreciated.
Thanks
Jacques