Hello,
I have a grid where I want to access the object containing the data at client side, in order to present details of the object
in another panel of the page. I have tried several variations to access the underline object and dataitem values without success.
I maybe overlooking the solutions somehow.
Here is a portion of my javascript . Nothing that I tried worked yet. I tried many variations of the below without success. Only the index value shows correctly on my page.
function OnRowSelected(sender, eventArgs)
{
var grid = $find("<%=TradesGrid.ClientID %>");
var index = eventArgs.get_itemIndexHierarchical();
var master = grid.get_masterTableView();
var row = master.get_dataItems()[index];
var newValues = master.extractValuesFromItem(index);
var newValuesSB = new Sys.StringBuilder();
newValuesSB.append("this is a test </br>");
for(var property in newValues)
{
newValuesSB.append(String.format("<b>{0}</b> : {1} <br/>", property,newValues[property]));
}
document.getElementById("<%= QuantityDetail.ClientID %>").innerHTML = "123" + index;
document.getElementById("<%= PriceDetail.ClientID %>").innerHTML = newValuesSB.toString();
document.getElementById("<%= InitialLoan.ClientID %>").innerHTML =row["InitialLoan"];
Thanks.
Joao,
I have a grid where I want to access the object containing the data at client side, in order to present details of the object
in another panel of the page. I have tried several variations to access the underline object and dataitem values without success.
I maybe overlooking the solutions somehow.
Here is a portion of my javascript . Nothing that I tried worked yet. I tried many variations of the below without success. Only the index value shows correctly on my page.
function OnRowSelected(sender, eventArgs)
{
var grid = $find("<%=TradesGrid.ClientID %>");
var index = eventArgs.get_itemIndexHierarchical();
var master = grid.get_masterTableView();
var row = master.get_dataItems()[index];
var newValues = master.extractValuesFromItem(index);
var newValuesSB = new Sys.StringBuilder();
newValuesSB.append("this is a test </br>");
for(var property in newValues)
{
newValuesSB.append(String.format("<b>{0}</b> : {1} <br/>", property,newValues[property]));
}
document.getElementById("<%= QuantityDetail.ClientID %>").innerHTML = "123" + index;
document.getElementById("<%= PriceDetail.ClientID %>").innerHTML = newValuesSB.toString();
document.getElementById("<%= InitialLoan.ClientID %>").innerHTML =row["InitialLoan"];
Thanks.
Joao,