Hi,
I have a simple hierarchical grid with a master table and a single detail table. The desired behavior is when the user expands the master table row and clicks on a row in the detail table a js function is called etc. All of this works fine except for the rowIndex is off by one. The javascript I have is below...please note it is not the most efficient right now, I have it to this trying to figure out what is wrong. In the 4th row of the script I originally had var row = DetailTable.get_dataItems()[dataItem.rowIndex]; but for the first row it was returning 1, second 2, etc. like it was 1 based. I added a -1 to pull back the previous row and this works but not sure if that is the best approach. Any thoughts on how I could better extract the 'UserID value from the detail table row the user double clicked on?
Thanks in advance,
K
I have a simple hierarchical grid with a master table and a single detail table. The desired behavior is when the user expands the master table row and clicks on a row in the detail table a js function is called etc. All of this works fine except for the rowIndex is off by one. The javascript I have is below...please note it is not the most efficient right now, I have it to this trying to figure out what is wrong. In the 4th row of the script I originally had var row = DetailTable.get_dataItems()[dataItem.rowIndex]; but for the first row it was returning 1, second 2, etc. like it was 1 based. I added a -1 to pull back the previous row and this works but not sure if that is the best approach. Any thoughts on how I could better extract the 'UserID value from the detail table row the user double clicked on?
Thanks in advance,
K
function RowSelected(sender, eventArgs) {
if (eventArgs.get_tableView().get_name() == "UserDetail") {
var dataItem = $get(eventArgs.get_id());
var DetailTable = eventArgs.get_tableView();
var row = DetailTable.get_dataItems()[dataItem.rowIndex-1]; //I had to add -1 in order to return the correct row
var cell = DetailTable.getCellByColumnUniqueName(row, "UserID");
var IDu = cell.innerHTML
$find("<%=RadAjaxPanel.ClientID%>").ajaxRequest("GoToDetails|" + IDu);
return false;
}
}