gvas / knockout-jqueryui

Knockout bindings for the jQuery UI widgets.
http://gvas.github.com/knockout-jqueryui/
MIT License
103 stars 38 forks source link

When the tab list changes, the tabs are not updated #21

Closed ehartford closed 10 years ago

ehartford commented 10 years ago

I had the same issue as this stack overflow when I use the knockout-jqueryui tabs binding.

http://stackoverflow.com/questions/8056610/jquery-ui-tab-init-after-array-change-in-knockoutjs

Then I added RPs binding like this:

<div id="tabs" data-bind="jqTabs: kpis, tabs: { refreshOn: kpis, active: $root.selectedKpiTab }">

and my issue is fixed.

So I wonder if RP's binding handler jqTabs from that SO question can be added into the knockout-jqueryui binding handler so that the tab control is destroyed and rebuild when the tabs list changes?

gvas commented 10 years ago

Could you make a jsfiddle to demonstrate your problem?

The SO question's original poster tried to refresh the tabs by directly invoking the tabs() method of the jQuery UI tabs widget. Normally you shouldn't do that, use the binding's refreshOn option instead, as in the example of the binding's documentation.