Dave
Dave

Reputation: 2576

jQuery Mobile Column Toggle and Knockoutjs binded table not working together

I have a table that gets populated with data based on a knockout model. I want to be able to use jQuery mobile's new column toggle feature but it's not working properly with rows populated from a knockout model.

Not sure how I can get this to work if someone could enlighten me that would be great.

Here is a jsfiddle of the issue, if you comment out the

ko.applyBindings(viewModel);

the table should work as expected, but apply the bindings and the column rows never disappear.

http://jsfiddle.net/DyUHA/2/

Upvotes: 0

Views: 708

Answers (2)

Dave
Dave

Reputation: 2576

Until a patch comes out from jQM I resorted to doing this:

http://jsfiddle.net/DyUHA/4/

$('.holder table')
.attr('data-mode', 'columntoggle')
.attr('data-role', 'table')
.table();

which works really well for me as my data is just loaded in via ajax and is never changed.

Upvotes: 3

PatrickSteele
PatrickSteele

Reputation: 14677

It appears that this is not a problem specific to knockout, but with the toggle-column table widget itself: https://forum.jquery.com/topic/jqm-1-3-0-dynamic-column-toggle-table

Upvotes: 0

Related Questions