javascript - Jquery Mobile Autocomplete with Ajax and Knockout JS is not Updating Layout -


i trying update radio buttons knockout js. retrieve data ajax call similar example. works far. data retrieved , passed model. , list generated.

enter image description here

the problem jquery not "skining" radio list. (upper part on image) working parsed json-string works fine. (lower part on image)

any ideas?

thanks

code:

html

   <fieldset id="mylist" data-role="controlgroup" data-bind="foreach: myvals">            <label data-bind="text:$data, attr: { for:'vals'+$data}"></label>            <input type="radio" data-bind="checked:$root.selectedvals, value:$data ,attr: {name: 'list', id:'vals'+$data}" >    </fieldset>...  

javascript

            // knockout             function viewmodel() {                 self = this;                 self.myvals = ko.observablearray();                 self.selectedvals = ko.observable();             }             var vm = new viewmodel();             ko.applybindings(vm);              // jquery             $(document).on("pageinit", "#mypage", function() {                 $("#autocomplete").on("filterablebeforefilter", function(e, data) {                      var $input = $(data.input), value = $input.val();                      if (value && value.length > 2) {                          $.ajax({                           ... data                         })                                 .then(function(response) {                                     vm.myvals.removeall(); // clear results won't add                                      $.each(response, function(i, val) {                                         vm.myvals.push(val); // fill array                                      });                                  });                     }                 });             }); ... 


Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -