json2htmled jQuery mobile button inside table td looks old, has old button inside new one after button()/refresh

浪子不回头ぞ 提交于 2019-12-12 19:31:23

问题


I'm using this transform to build a jQuery mobile button inside of a regular table 'td':

{
    "tag":"button",
    "type":"button",
    "id":"${idPrefix}-delete",
    "data-role":"button",
    "data-mini":"true",
    "data-icon":"delete",
    "html":"Delete"
}

but it renders as an old HTML button.

After I manually refresh the button, it looks like a mobile button with the icon, but the old button is "minified" inside of it.

How can this be fixed?


missing ::before?

I just compared it to a normal looking mobile button, and the problematic button is missing the ::before right before the <button> tag.


I removed all of the mobile attributes and tried to call button() later, same result.


回答1:


To speed-up webapp initializing and to increase jQM's performance, jQM team decided to drop .buttonMarkup() widget and replace it with classes.

There is no longer data-role=button, data-mini=true, etc... All are replaced with classes as follows.

To convert a button or an anchor into a jQM button, just add ui-btn class. To add an icon with position ui-btn-icon-left, right, top, bottom. Icon's image ui-icon-bars, delete, info, etc. Mini button/anchor ui-mini. Button's theme ui-btn-a or b.

<button class="ui-btn ui-mini ui-btn-icon-right ui-icon-delete">Button</button>

Demo



来源:https://stackoverflow.com/questions/22312810/json2htmled-jquery-mobile-button-inside-table-td-looks-old-has-old-button-insid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!