EasyUI - Combo组件
2015-10-24 16:13
399 查看
-自定义下拉组件,有别于ComboBox下拉组件。
效果:
html代码:
JS代码:
效果:
html代码:
<input id ="box" /> <div id ="fruits" style ="padding:5px;"> <div>请选择一种水果:</div> <div> <input type ="radio" name ="fruit" value ="01"/><span>苹果</span><br /> <input type ="radio" name ="fruit" value ="02"/><span>香蕉</span><br /> <input type ="radio" name ="fruit" value ="03"/><span>橘子</span><br /> <input type ="radio" name ="fruit" value ="04"/><span>芒果</span><br /> </div> </div>
JS代码:
$(function () { $('#box').combo({ // * 集成自ValidateBox * required: true, editable: false, delay:100, missingMessage:'请选择值!', }) //将内容添加到Combo组件中 $('#fruits').appendTo($('#box').combo('panel')); //点击选项在文本框中显示值 $('#fruits input').click(function () { var v = $(this).val();//获取选中radio的value值 var s = $(this).next('span').text();//获取选中radio的text值 //将获取的值,设置到文本框的text,value中,并隐藏panel $('#box').combo('setValue', v).combo('setText', s).combo('hidePanel'); }) })
相关文章推荐
- A cycle was detected in the build path of project
- GUID(转载)
- (转载)全球唯一标识GUID
- 全局唯一标识符(GUID)
- easyui 入门
- hdu5057 Argestes and Sequence 分块
- 淘宝tair--分布式 key/value 存储引擎
- UITabelView 介绍
- 从客户端中检测到有潜在危险的 Request.Form 值 --MVC
- APUE学习总结
- NSOperation之 设置UITabView的有沙盒图片缓存——剖析内在原理
- EasyUI - ValidateBox 验证组件
- 【APUE】Chapter10 Signals
- request.getRequestDispatcher("msg.jsp") .forward(request, response);
- Android Device Monitor dump UI hierarchy 报错:Unexpected error while obtaining UI hierarchy
- SequenceFile使用随笔
- easyui动态隐藏/显示tab页
- Codeforces Round #276 (Div. 1) B. Maximum Value 筛倍数
- HDU 1216 Assistance Required(模拟)
- 1.1 IS Unique