`

jqm小组件的使用

    博客分类:
  • 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');

分享到:
评论
2 楼 三尺之尚 2014-01-20  
u012732154 写道
你好,
$("input[type='checkbox']").checkboxradio('disable');这种代码我写了怎么没效果啊

还需要刷新组件的。
1 楼 u012732154 2013-12-27  
你好,
$("input[type='checkbox']").checkboxradio('disable');这种代码我写了怎么没效果啊

相关推荐

Global site tag (gtag.js) - Google Analytics