I know that I can set options on a custom widget if I instantiate the widget in code, so that the following should output "foo" to the console.
Is there any way that I can do the same thing using declarative binding? I get as far as
but there doesn't seem to be anything I can put in for X that gives me access to the options parameter. I haven't been able to find anything in the blog posts or documentation to shed light on this.
var
MyWidget = kendo.ui.Widget.extend({
init:
function
(element, options) {
kendo.ui.Widget.fn.init.call(
this
, element, options);
console.log(options.myOption);
},
options: {
name:
"MyWidget"
}
});
kendo.ui.plugin(MyWidget);
$(
"#widgetRoot"
).kendoMyWidget({ myOption:
"foo"
});
<
span
id
=
"widgetRoot"
data-role
=
"mywidget" data-bind="X"
></
span
>