easyui-combobox如何使用选择器
2015-08-25 16:03
411 查看
HTML:
<input name="myinputdom" id="myinputdom" class="easyui-combobox
myinputdom" data-options="......" />
当使用如下选择器来操作combobox对象时,会出现不同的表现。
Javascript:
$('input[name=myinputdom]').combobox(...);//错误
$(':input[name=myinputdom]').combobox(...);//错误
$('#myinputdom').combobox(...);//正确
$('.myinputdom').combobox(...);//正确
分析:
使用firefox查看最终的页面代码如下:
<input id="myinputdom" class="easyui-combobox
combobox-f combo-f textbox-f" data-options="......" style="display:
none;" textboxname="myinputdom" comboname="myinputdom"><!-- 使用id和class选择器选中的是该元素,因为该元素属于easyui-combobox类型,所有可以使用combobox的方法 --!>
<span class="textbox combo" style="width:
132px; height: 20px;">
<span class="textbox-addon textbox-addon-right" style="right:
0px;">
<input class="textbox-text validatebox-text" type="text" autocomplete="off" readonly="readonly" placeholder="" style="margin-left:
0px; margin-right: 18px; padding-top: 2px; padding-bottom: 2px; width: 106px;">
<input class="textbox-value" type="hidden" name="myinputdom" value="3
hours"><!--
使用表单加属性选择器选中的是该元素,因为该元素不是easyui-combobox类型,所有无法使用combobox的方法 --!>
</span>
<input name="myinputdom" id="myinputdom" class="easyui-combobox
myinputdom" data-options="......" />
当使用如下选择器来操作combobox对象时,会出现不同的表现。
Javascript:
$('input[name=myinputdom]').combobox(...);//错误
$(':input[name=myinputdom]').combobox(...);//错误
$('#myinputdom').combobox(...);//正确
$('.myinputdom').combobox(...);//正确
分析:
使用firefox查看最终的页面代码如下:
<input id="myinputdom" class="easyui-combobox
combobox-f combo-f textbox-f" data-options="......" style="display:
none;" textboxname="myinputdom" comboname="myinputdom"><!-- 使用id和class选择器选中的是该元素,因为该元素属于easyui-combobox类型,所有可以使用combobox的方法 --!>
<span class="textbox combo" style="width:
132px; height: 20px;">
<span class="textbox-addon textbox-addon-right" style="right:
0px;">
<input class="textbox-text validatebox-text" type="text" autocomplete="off" readonly="readonly" placeholder="" style="margin-left:
0px; margin-right: 18px; padding-top: 2px; padding-bottom: 2px; width: 106px;">
<input class="textbox-value" type="hidden" name="myinputdom" value="3
hours"><!--
使用表单加属性选择器选中的是该元素,因为该元素不是easyui-combobox类型,所有无法使用combobox的方法 --!>
</span>
相关文章推荐
- 代码里手动编写UI
- building live555 library for iphoneos
- POJ 2524 Ubiquitous Religions 并查集
- [leetcode] 95.Unique Binary Search Trees II
- UILabel设置圆角和背景
- 外来人员如何发起流程与参与内部流程?CCFlow中Guest流程说明
- 回顾交互设计史:回归人性,重拾质朴
- POJ - 2524 Ubiquitous Religions(简单并查集)
- Repository 返回 IQueryable?还是 IEnumerable?
- HDU 1159 Common Subsequence
- uestc 250 windy数(数位dp)
- 外来人员如何发起流程与参与内部流程?CCFlow中Guest流程说明
- BUILD
- UE4引擎学习
- fuel自动安装openstack文档
- 【工具】 原版完美激活 Flash builder 4.7 【非破解激活】
- 关于listview item 子控件焦点的问题。
- 科室管理系统中,运用百度编辑器(ueditor1_4_3-utf8-jsp)出现的一系列问题!
- Android消息处理机制——Looper,Handler,Message,MessageQueue,Thread
- 分析公式 Codeforces 528B Clique Problem