javascript - jQuery mobile 1.4 not enhancing content added with knockout.js -


i create list of elements knockout.js 'foreach', , want these enhanced jquery mobile buttons.

  <div data-role="content" class="content">      <div id="buttoncontainer" data-bind="foreach: buttons">         <div class="controllerbutton" data-role="button">                             <span class="buttontext" data-bind="text: label"></span>         </div>      </div>            </div> 

using jquery mobile 1.3.2, works fine. 1.4 alpha, jquery mobile doesn't elements.

(i'm aware i'm asking alpha without documentation, features panels outside of pages make switch attractive @ point in time.)

as of jquery mobile 1.4 data-role=button deprecated , removed on 1.5. replaced adding classes directly anchor. main class ui-btn convert element button.

html

<div data-role="content" class="content">   <div id="buttoncontainer" data-bind="foreach: buttons">     <!-- adds button , icon classes -->     <a class="controllerbutton" data-bind="text: label, css: icon">     </a>   </div> </div> 

js

ko.applybindings({     buttons: [{         "label": "one",             "icon": "ui-btn ui-icon-home ui-btn-icon-top"     }, {         "label": "two",             "icon": "ui-btn ui-icon-arrow-r ui-btn-icon-right"     }, {         "label": "three",             "icon": "ui-btn ui-icon-edit ui-btn-icon-bottom"     }, {         "label": "four",             "icon": "ui-btn ui-icon-info ui-btn-icon-left"     }, {         "label": "five",             "icon": "ui-btn ui-icon-delete ui-btn-icon-notext"     }] }); 

demo


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -