This is a migrated thread and some comments may be shown as answers.

Error: 'MasterTable' is undefined

2 Answers 117 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ismail
Top achievements
Rank 1
Ismail asked on 07 Oct 2008, 11:23 AM
Hi

Please can someone help me..

i'm using RadGrid Ajax Grid, my coed is returning an error 'MasterTable' is undefined..
i also tried
var grid = sender;


function RowSelected(sender, eventArgs)
{
var dataItem = $get(eventArgs.get_id());

var grid = $find("<%=RadGrid1.ClientID %>");
var MasterTable = grid.get_masterTableView();
var row = MasterTable.get_dataItems()[dataItem.rowIndex];
var cell = MasterTable.getCellByColumnUniqueName(row, "tServer.id");

//here cell.innerHTML holds the value of the cell
}
 function redirectToConfig()
 {
    var selectedRows = MasterTable.get_selectedItems();
    var row = selectedRows[0];
    window.location = 'ServerConfig.aspx?id='+row
 }
</script>
</telerik:RadCodeBlock>

<input onclick="redirectToConfig();" type="button" value="View Server Config"/>

2 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 07 Oct 2008, 11:28 AM
Hello Ismail,

MasterTable is declared as local variable in the scope of RowSelected JavaScript function.

Kind regards,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ismail
Top achievements
Rank 1
answered on 07 Oct 2008, 12:22 PM
Haha,i feel like an idiot...Tanks :)
Tags
Grid
Asked by
Ismail
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Ismail
Top achievements
Rank 1
Share this question
or