BorisMoore / jsviews

Interactive data-driven views, MVVM and MVP, built on top of JsRender templates
http://www.jsviews.com/#jsviews
MIT License
856 stars 130 forks source link

jqueryui accordion create event not triggered #412

Closed mwyrembl closed 5 years ago

mwyrembl commented 5 years ago

When I use the following syntax to create a jqueryui accordion:

{^{accordion _create=~accordionCreate _beforeActivate=~accordionBeforeActivate}}
...
{{/accordion}}

It only triggers the beforeActivate event but not the create event. Is there any workaround for this?

BorisMoore commented 5 years ago

Ah - yes, that should work. I'll fix it for the next update.

Here is a patched version of the jsviews-jqueryui-widgets.js. Can you test, and confirm it works for you:

jsviews-jqueryui-widgets.js.txt

If it doesn't then you can use a workaround: Add the following onBind callback:

{^{accordion onBind=~onbnd _create=~accordionCreate _beforeActivate=~accordionBeforeActivate}}
...
{{/accordion}}
onbnd: function() {
    this.initOptions.push("create");
    this.baseApply(arguments);
}
BorisMoore commented 5 years ago

Fixed in v1.0.2