Tim
Tim

Reputation: 475

Grid Column ClientTemplate not working

I have a Hierarchy style Kendo grid and the inner grid doesn't seem to accept client templates. (I stripped the code irrelevant grid configuration columns out )
I really would like the client template to be something like <a title="#=AlarmStatusDescription#">#=AlarmStatus#</a> but anytime I put anything other than a simple string in the ClientTemplate, the whole grid fails to load.

I've tried

Upvotes: 2

Views: 8520

Answers (2)

Petur Subev
Petur Subev

Reputation: 20233

You need to escape the sharp symbols - other way the Outer Grid will try to evaluate this "#:AlarmStatus#" expression. And since most probably there is no such field as AlarmStatus for the Outer Grid (it is property of the Inner one) there will be an exception. If you escape it like this the client template should be skipped by the Outer Grid, and evaluated properly by the Inner Grid.

.ClientTemplate("\\#= AlarmStatus \\#")

I hope you got the idea

Upvotes: 19

OnaBai
OnaBai

Reputation: 40887

You should use: .ClientTemplate("#= AlarmStatus #"). I think that you were missing the quotes ".

Upvotes: 1

Related Questions