okai i am following a tutorial on rad grid using hierarchies , so when on command event is triggered from the nested table i want to get a reference to the parent row that contains this nested table i am pasting the logic that is used in the tutorial , but its rather very complicated
function RadGrid2_Command(sender, args) {
ordersView = sender.get_masterTableView();
var nestedViewItem = sender.get_element().parentNode.parentNode;
var parentGridDataItem = $find(Telerik.Web.UI.Grid.GetNodePreviousSiblingByTagName(nestedViewItem, "tr").id);
var customerID = parentGridDataItem.getDataKeyValue("CustomerID");
args.set_cancel(true);
ordersCommandName = args.get_commandName();
WebService.GetOrdersByCustomerID(customerID, ordersView.get_currentPageIndex() * ordersView.get_pageSize(), ordersView.get_pageSize(),
ordersView.get_sortExpressions().toString(), ordersView.get_filterExpressions().toDynamicLinq(),
updateOrdersGrid);
}
but why cant i use
var c = sender.get_masterTableView().get_parentRow();
method ?, its returning null when i use it in the on command event , and if any one of you can please explain me the logic behind the on command event that i have pasted , i will be much grateful!!!
function RadGrid2_Command(sender, args) {
ordersView = sender.get_masterTableView();
var nestedViewItem = sender.get_element().parentNode.parentNode;
var parentGridDataItem = $find(Telerik.Web.UI.Grid.GetNodePreviousSiblingByTagName(nestedViewItem, "tr").id);
var customerID = parentGridDataItem.getDataKeyValue("CustomerID");
args.set_cancel(true);
ordersCommandName = args.get_commandName();
WebService.GetOrdersByCustomerID(customerID, ordersView.get_currentPageIndex() * ordersView.get_pageSize(), ordersView.get_pageSize(),
ordersView.get_sortExpressions().toString(), ordersView.get_filterExpressions().toDynamicLinq(),
updateOrdersGrid);
}
but why cant i use
var c = sender.get_masterTableView().get_parentRow();
method ?, its returning null when i use it in the on command event , and if any one of you can please explain me the logic behind the on command event that i have pasted , i will be much grateful!!!