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

[Solved] Client side api errors

5 Answers 100 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 22 Oct 2012, 08:22 PM
I'm getting an error "Object doesn't support property or method 'get_masterTableView'" when I try to access the mentioned method on the client side. The grid definition mark-up is below. My Javascript file in a separate file. I bind the grid in the OnNeedDataSource event handler and the grid data is displayed fine. Do I need to have a reference to any  Telerik javascript libraries in the page?


<telerik:RadGrid ID="TerritoriesRadGrid" runat="server" AutoGenerateColumns="false"
            AllowPaging="true" OnNeedDataSource="TerritoriesRadGrid_NeedDataSource" OnItemCommand="TerritoriesRadGrid_ItemCommand">
            <GroupingSettings CaseSensitive="False" />
            <ExportSettings HideStructureColumns="true" FileName="Territories" Excel-Format="Biff"
                OpenInNewWindow="false" Excel-FileExtension="xls" IgnorePaging="true" ExportOnlyData="false" />
            <MasterTableView EditMode="PopUp" AllowFilteringByColumn="true" AllowSorting="true"
                CommandItemDisplay="Top">
                
                <CommandItemSettings ShowExportToExcelButton="true" ExportToExcelText="Export to Excel"
                    ShowAddNewRecordButton="false" />
                <Columns>
                     <telerik:GridBoundColumn DataField="TerritoryDisplay" HeaderText="Territory" HeaderStyle-Width="5em">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="SalesPersonRacfId" HeaderText="Sales Person RACF ID">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="SalesPersonFullName" HeaderText="Sales Person Name">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="SalesPersonPositionName" HeaderText="Sales Person Job Title">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="SalesPersonOrgUnitLevel1" HeaderText="Sales Person Org Unit Level 1">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="SalesPersonOrgUnitLevel2" HeaderText="Sales Person Org Unit Level 2">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="SalesPersonOrgUnitLevel3" HeaderText="Sales Person Org Unit Level 3">
                     </telerik:GridBoundColumn>
                   /Columns>
            </MasterTableView>
        </telerik:RadGrid>

Thanks, 
Alex

5 Answers, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 23 Oct 2012, 02:41 PM
Hello Alex,

You don't need such references, but since your code is in an external file, I suppose you are passing the wrong client ID for the grid. To get the grid's client-side component you should call:
var grid = $find("grid's client id");

One possible solution to the issue is to attach an event handler to the grid's OnGridCreated client-side event, take the incoming sender object and assign it to a global javascript variable:
RadGrid1.ClientSettings.ClientEvents.OnGridCreated = "gridIsCreated";

var grid;
function gridIsCreated(sender, args)
{
     grid = sender;
}


Hope it helps.

Regards, Tsvetoslav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Alex
Top achievements
Rank 1
answered on 24 Oct 2012, 01:28 PM
Thanks, my problem was a bit different, but your reply helped me to solve it.
0
Tsvetoslav
Telerik team
answered on 25 Oct 2012, 02:55 PM
Glad to hear that.


Regards, Tsvetoslav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Tim
Top achievements
Rank 1
answered on 26 May 2013, 07:23 PM
I have a Grid inside a FormView, and I don't know if this is the cause of the problem, but NONE of the grid's JavaScript API will load... NONE!  You cannot use "$find", you cannot hook into the OnGridCreated event, nothing works.  Has anyone else run into this?  It's as if the Grid does not want to register it's JS API on a PostBack.
0
Viktor Tachev
Telerik team
answered on 30 May 2013, 04:15 AM
Hi Tim,

I have answered your query in the other thread you have opened. I would suggest to continue the conversation there.

Additionally, please note that It is highly recommended that you keep related questions in one support thread or a forum post, so that we can easily keep track of your support history and provide better answers in a shorter time.

Regards,
Victor Tachev
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Alex
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Alex
Top achievements
Rank 1
Tim
Top achievements
Rank 1
Viktor Tachev
Telerik team
Share this question
or