Hi,
I've defined a custom binding which works prefectly when used outside templates, but it will not work when used within one.
The binding's refresh function is called in both cases, but when used within a template, this.bindings["bindingName"].get() returns undefined.
Is this a limitation of the curent state of bindings ? Is there a workaround ?
here's the code:
Funny thing is that the click binding works within the template...
Thanks
I've defined a custom binding which works prefectly when used outside templates, but it will not work when used within one.
The binding's refresh function is called in both cases, but when used within a template, this.bindings["bindingName"].get() returns undefined.
Is this a limitation of the curent state of bindings ? Is there a workaround ?
here's the code:
kendo.data.binders.cssClass = kendo.data.Binder.extend({
refresh:
function
() {
var
value =
this
.bindings[
"cssClass"
].get();
$(
this
.element).removeClass();
$(
this
.element).addClass(value);
}
});
<
script
id
=
"path-template"
type
=
"text/x-kendo-template"
>
<
li
data-bind
=
"click: goToFolder, cssClass: theStyle"
>#: path #</
li
>
</
script
>
Funny thing is that the click binding works within the template...
Thanks