This question is locked. New answers and comments are not allowed.
I am using the telerik grid as well.
In my grid, for each row I need to call a script. Since I have started to implement using the Script Registrar, these calls in my rows are firing because its says the function is undefined. Here is an example:
Init my Grid:
Then I call Script Registrar:
I get no errors until I click the link and it says that test() is undefined.
Any ideas ?
In my grid, for each row I need to call a script. Since I have started to implement using the Script Registrar, these calls in my rows are firing because its says the function is undefined. Here is an example:
Init my Grid:
| <% Html.Telerik().Grid<aspnet_Role>(Model.People) |
| .Name("peopleGrid").PrefixUrlParameters(false) |
| .AssetKey("roleAssetGroup") |
| .Columns(columns => |
| { |
| columns.Add(r => r.Name).Title("Name"); |
| columns.Add(r => |
| { |
| %> |
| <%= String.Format("<a id='btn{0}' href=\"javascript:test();\">Delete</a><div id='modal{0}'></div>", r.PeopleId, Url.Content("~/"), r.Name)%> |
| <% |
| }).Title(" ").Width(50).HtmlAttributes(new { align = "center" }); |
| }) |
| .Scrollable(scrolling => scrolling.Height(500)) |
| .Render(); |
| %> |
Then I call Script Registrar:
| <% Html.Telerik().ScriptRegistrar() |
| .OnDocumentReady(() => |
| { %> |
| function test(){ |
| alert('hello world'); |
| } |
| <% }); %> |
I get no errors until I click the link and it says that test() is undefined.
Any ideas ?