I am following the MVVM SPA pattern using kendo views and kendo router. Also, I am using RequireJS to load my js modules and html templates.
One of my templates is a simple kendo.Grid:
<DIV id="a-grid"
data-role="grid"
data-bind="source: source, events: { dataBound: dataBound, change: change }"
data-columns='[
{ "field": "aID", "title": "A", template: "#=aName( aID )#", editor: aEditor }]'>
</DIV>
It binds correctly to the source, event functions, and displays data.
I got to work the template function by defining it in the window context:
window.aName = function ( aID ) { ... return name; };
Although, I don't like putting it into global context.
How can I define the editor and template functions in my js modules?
Thanks,
Greg.
One of my templates is a simple kendo.Grid:
<DIV id="a-grid"
data-role="grid"
data-bind="source: source, events: { dataBound: dataBound, change: change }"
data-columns='[
{ "field": "aID", "title": "A", template: "#=aName( aID )#", editor: aEditor }]'>
</DIV>
It binds correctly to the source, event functions, and displays data.
I got to work the template function by defining it in the window context:
window.aName = function ( aID ) { ... return name; };
Although, I don't like putting it into global context.
How can I define the editor and template functions in my js modules?
Thanks,
Greg.