Very surprised I couldn't find more information on this. Most grid libraries allow direct js functions for their column renders. In the case of Kendo UI it must be a string template, which is quite limiting. The problem I am currently facing is this:
I have no way to access a member method in my template. This is crazy limiting. ANY of the following scenarios would be workable:
The current requirement that only global methods can be called is severe (not to mention a terrible practice). Please advise on how to circumvent this limitation.
// Inside my view
config: {
a:
"A"
,
b:
"B"
},
foo:
function
(data) {
return
this
.config[data.config];
},
initGrid:
function
() {
this
.ui.grid.kendoGrid({
columns: [{
title:
"Column A"
,
field:
"columnA"
,
template:
"#= this.foo(data) #"
}]
});
}
I have no way to access a member method in my template. This is crazy limiting. ANY of the following scenarios would be workable:
// Direct function access
template:
this
.foo
// Set scope of template execution
template: { template:
"#= this.foo(data) #"
, scope:
this
}
// Templates always executed in scope they are defined in
template:
"#= this.foo(data) #"
// Just works
The current requirement that only global methods can be called is severe (not to mention a terrible practice). Please advise on how to circumvent this limitation.