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

[Solved] Replacement for objectData

5 Answers 93 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Eliyahu Goldin
Top achievements
Rank 1
Eliyahu Goldin asked on 07 Jun 2008, 08:27 PM
I get to my grid in the .aspx file as

function getGrid()
{
    return window["<%= grMessageList.ClientID %>"];
}

Then, in a separate javascript file, following the code in one of your samples, I get the MasterTableView as

mocsRadGrid = getGrid();
mocsRadMasterTableView = mocsRadGrid.MasterTableView ==

null ? mocsRadGrid.objectData.MasterTableView : mocsRadGrid.MasterTableView;

After upgrading to the RadControls for ASP.NET AJAX, this code doesn't work any more. I am getting an error that objectData is null. I tried get_MasterTableView() call but it is not recognized. The code runs on the first page load, not in an ajax postback.

What is the correct syntax now?

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 09 Jun 2008, 07:21 AM
Hi,

Go through the following help article.
Getting RadGrid client object

Shinu.
0
Eliyahu Goldin
Top achievements
Rank 1
answered on 09 Jun 2008, 09:23 PM
No, this doesn't seem to be relevant to my problem.

I don't have any trouble with getting client reference to the grid. The problem is that the client object for the grid doesn't seem to include objectData anymore. The question remains: What is the replacement for objectData in the new grid?
0
Vlad
Telerik team
answered on 10 Jun 2008, 08:08 AM
Hello Eliyahu,

Please check this example to know more about how to get reference to the MasterTableView on the client:
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/Hierarchy/HierarchyLoadModeClient/DefaultCS.aspx

Sincerely yours,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Eliyahu Goldin
Top achievements
Rank 1
answered on 10 Jun 2008, 08:34 PM
I am confused by all these examples referring to scripts in RadCodeBlocks. My code runs not in Ajax calls, it is just in a regular <body onload> event. Even if it is in Ajax calls, I don't need to use the RadAjaxManager. In fact, calls to $find("<%= myGrid.ClientID %>") and $find("<%= myGrid.MasterTableView.ClientID %>") return null outside of Ajax calls. Old style window["<%= myGrid.ClientID %>"] and window["<%= myGrid.MasterTableView.ClientID %>"] do return client objects.

My next problem is that the new client model doesn't seem to include Rows array. My code myMasterTableView.Rows[index] causes an error. I tried myMasterTableView.get_dataItems[index] and got the same "null" exception.
0
Konstantin Petkov
Telerik team
answered on 11 Jun 2008, 04:55 PM
Hello Eliyahu Goldin,

Please, review the client-side API explained here to resolve the problem. You just need to change the square brackets to the round ones.

Greetings,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
Eliyahu Goldin
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Eliyahu Goldin
Top achievements
Rank 1
Vlad
Telerik team
Konstantin Petkov
Telerik team
Share this question
or