How can I define a partial UI like:
// innerUI.js var innerUI = { ... };
then include the “innerUI” in another layout, like so:
// outerUI.js var outerUI = { rows : [ { view: "toolbar", // ... }, { view: innerUI // <-- insert UI here } ]};
then build the final layout:
// index.html < script include="innerUI.js"></ script> < script include="outerUI.js"></ script> ... < script> webix.ui(outerUI); </ script>
instead of { view: innerUI }
you should use only innerUI. as innerUI itself is an object
Your example is almost correct. Truly, you can include JS-files in the mentioned sequence and it will work as the needed variables will be available in time.
But please note that view
expects a name of one of the Webix components, not an object. Use the innerUI
instead of { view:innerUI }
:
http://webix.com/snippet/5cc3b5c3
Yeah that makes sense. It’s not a webix thing; it’s just an embedded json object.