jqm小组件的使用

文本输入框和文本输入域 Text inputs & Textareas

text输入框拥有如下方法:
enable
使一个输入框可用

HTML 代码:

$('.selector').textinput('enable');
disable
使一个输入框不可用

HTML 代码:

$('.selector').textinput('disable');	

  

复选按钮 Checkboxes

复选按钮拥有如下方法:
enable
使一个复选按钮可用

HTML 代码:

 $("input[type='checkbox']").checkboxradio('enable');
disable
使一个输入框不可用

HTML 代码:

$("input[type='checkbox']").checkboxradio('disable');
refresh
更新复选按钮
如果通过js修改了复选按钮,必须通过refresh 来更新复选按钮的外观。

HTML 代码:

$("input[type='checkbox']:first").attr("checked",true).checkboxradio("refresh");

  

单选按钮组 Radio buttons

 

复选按钮拥有如下方法:
enable
使一个复选按钮可用

HTML 代码:

 $("input[type='checkbox']").checkboxradio('enable');
disable
使一个输入框不可用

HTML 代码:

$("input[type='checkbox']").checkboxradio('disable');
refresh
更新复选按钮
如果通过js修改了复选按钮,必须通过refresh 来更新复选按钮的外观。

HTML 代码:

$("input[type='checkbox']:first").attr("checked",true).checkboxradio("refresh");

 

列表标记的规约List markup conventions

refresh
刷新listview
如果用js手动修改了一个listview,必须调用refresh方法刷新listview的外观。

Java Script代码:

$('.selector').listview('refresh');

 

选择菜单 Select menus

刷新选择菜单 Refreshing a select

如果你通过js操作了选择菜单,务必通过refresh 方法来更新他的样式。
var myselect = $("select#foo");
myselect[0].selectedIndex = 3;
myselect.selectmenu("refresh");

disable()

disable a text input.
  • This method does not accept any arguments.
Code examples:

Invoke the disable method:

1
$( ".selector" ).selectmenu( "disable" );

enable()

enable a disabled text input.
  • This method does not accept any arguments.
Code examples:

Invoke the enable method:

1
$( ".selector" ).selectmenu( "enable" );

refresh()

update the custom select.

This is used to update the custom select to reflect the native select element's value. If the number of options in the select are different than the number of items in the custom menu, it'll rebuild the custom menu.

  • This method does not accept any arguments.
Code examples:

Invoke the method:

1
$( ".selector" ).selectmenu( "refresh" );

 

 

引用: http://www.jqmapi.com/

 

使用瀑布流代码是出现的问题。在火狐的firebug中。

cannot call methods on masonry prior to initialization; attempted to call method 'refresh'  

找到解决问题,需要在使用的时候,初始化一次,代码。

$restrict_date_begin.textinput().textinput('enable');

$("#enable_print").checkboxradio().checkboxradio('enable');

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值