This page compares both syntaxes for using Wijmo with KnockoutJS.
Wijmo offers two similar, yet different, syntaxes for using the controls within KnockoutJS applications:
If you've worked with KnockoutJS before, you're probably familiar with custom binding syntax. Custom
bindings are used with normal HTML elements, typically a <div>
, using the data-bind
attribute. The binding name corresponds to the control name with a wj prefix. The value of the binding
will be a JavaScript object literal containing properties and event handlers that map to the Wijmo control.
As an alternative to the standard KnockoutJS binding syntax, the Wijmo offers the possibility to declare controls in the page markup as custom elements. With custom elements, the tag name corresponds to the control's binding name and the attribute names correspond to the control's property names. The element and parameter names must be lower-case and use dashes instead of using camel-case. It is important to mention that attribute values should be defined using exactly the same JavaScript expressions that are used in the custom binding definitions.
The examples below aim to illustrate both syntaxes for most of the Wijmo controls.