This question is locked. New answers and comments are not allowed.
Hello,
I'm putting together a demo evaluating the Telerik controls, and I'm trying to define a grid column that has a template that depending on the value of that column displays one of two images. I want to include the value from another column as an attribute for later use in the image's click handler, but am receiving a javascript error if I refer to any column other than the current one in the template. Here is what I am doing:
This gives me an Invalid character error from telerik.grid.min.js however. If I replace <#= Id #>
with <#= LabelCount #> everything works fine(except for not giving me the data I want). I've tried prefixing Id with c. and dataItem. with no success. What's the proper way to do this, or if it's impossible for some reason how can I achieve clicking the image calling a javascript function with another columns value as a parameter? I'm using MVC Q3 2011.
I'm putting together a demo evaluating the Telerik controls, and I'm trying to define a grid column that has a template that depending on the value of that column displays one of two images. I want to include the value from another column as an attribute for later use in the image's click handler, but am receiving a javascript error if I refer to any column other than the current one in the template. Here is what I am doing:
cols.Bound(c=> c.LabelCount). ClientTemplate("<# if (LabelCount > 0)" + " { return '<img src=\"..."\" onclick=\"LabelClicked(this)\" EntryId = \"<#= Id #>\" />'; } else " + "{ return '<img src=\"...(disabled version)"\" />'; } #>")This gives me an Invalid character error from telerik.grid.min.js however. If I replace <#= Id #>
with <#= LabelCount #> everything works fine(except for not giving me the data I want). I've tried prefixing Id with c. and dataItem. with no success. What's the proper way to do this, or if it's impossible for some reason how can I achieve clicking the image calling a javascript function with another columns value as a parameter? I'm using MVC Q3 2011.