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

[Solved] Binding Data for grid using web asset

1 Answer 78 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Gabe
Top achievements
Rank 1
Gabe asked on 25 Apr 2011, 08:24 PM
I have a Class Library that contains some common scripts that I use across multiple projects.
The class library contains an embedded resource that has some script related to common grid functionality.
In this case I am trying to bind data to the grid such as:

 $.post(rooturl + "HomeController/GetGridData"function (data) {
        var grid = $('#' + gridid).data('tGrid');
        grid.dataBind(data.Data);
 }

The web asset is loaded it just fails on the first line of the above callback:
var grid = $('#' + gridid).data('tGrid');

grid is undefined, the data() method is not working for some reason.

If I take this same script and just include it into the MVC project and not use the resource from the Class Library, everything works fine (Using the ScriptRegistrar). Do I have to use the Script Registrar to have this functionality work properly? If so how can I include a web asset as an added script to the registrar?
So I know its not the actual script problem, it seems to be that the embedded resource doesn't have a reference to some telerik library.
In my class library, I have a reference to Telerik.Web.Mvc, I also included a folder in my Class Library called "Scripts/2011.1.315/" with all the Telerik scripts in it.

Is there something I am missing?

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 26 Apr 2011, 10:09 AM
Hello Gabe,

Can you please verify that the script in question is loaded after the grid scripts are included and grid object is constructed and initialized.

All the best,
Rosen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Gabe
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or