//------录入时间,下拉列表框------
var inputTimeRow = new Ext.data.Record.create([
{
name : 'value'
},{
name : 'text'
}
]);
var inputTimeReader = new Ext.data.JsonReader({
fields : inputTimeRow
});
var inputTimeProxy = new Ext.data.HttpProxy({
url : actionUrl
});
var inputTimeStore = new Ext.data.JsonStore({//配置项数据源
baseParams:{action:'getInputTime'},
pruneModifiedRecords : true,
proxy : inputTimeProxy,
reader : inputTimeReader,
fields : inputTimeRow
});
inputTimeStore.load(); var inputTimeComboBox = new Ext.form.ComboBox({
//value : '数据',
store : inputTimeStore,
triggerAction : 'all',
lazyRender : true,
typeAhead : true,// 允许自动选择匹配的剩余部分文本
displayField : 'text',
valueField : 'value',
selectOnFocus : true,
mode : 'local',
readOnly:false,
editable:false,
emptyText : '选择时间',
fieldLabel: '录入时间',
id: 'InputTime',
name: 'InputTime',
tpl:'<tpl for="."><div class="x-combo-list-item"><span><input type="checkbox" {[values.check?"checked":""]} value="{[values.text]}" /></span><span >{text}</span></div></tpl>',
onSelect : function(record, index){
if(this.fireEvent('beforeselect', this, record, index) != false){
record.set('check',!record.get('check'));
var str=[];//页面显示的值
var strvalue=[];//传入后台的值
this.store.each(function(rc){
if(rc.get('check')){
str.push(rc.get('text'));
strvalue.push(rc.get('value'));
}
});
this.setValue(str.join());
this.value=strvalue.join();//赋值
this.fireEvent('select', this, record, index);
}
},
listeners:{
expand : function(value){//监听下拉事件
this.store.each(function(rc){
if(value.value==rc.get('value')){
rc.set('check',true);//选中
}
})
}
},
width:105
});

Extjs下拉多选框的更多相关文章

  1. 我的第一个jquery插件:下拉多选框

    <!DOCTYPE HTML> <html> <head> <title> New Document </title> <meta n ...

  2. 使用jQuery为文本框、单选框、多选框、下拉框、下拉多选框设值及返回值的处理

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/ ...

  3. angular2.x 下拉多选框选择组件

    angular2.x - 5.x 的下拉多选框选择组件 ng2 -- ng5.最近在学angular4,经常在交流群看见很多人问 下拉多选怎么做... 今天就随便写的个. 组件源码 百度云   链接: ...

  4. 品优购商城项目(二)AngularJS、自动代码生成器、select2下拉多选框

    品优购商城想项目第二阶段 AngularJS.自动代码生成器.select2下拉多选框 完成了课程第三天.第四天的的任务. 1.学习了AngularJs前端的mvc分层思想,js部分分成control ...

  5. 自己用ul模拟实现下拉多选框,

    模拟实现下拉多选框 效果如下 <!DOCTYPE html> <html lang="en"> <head> <meta charset= ...

  6. jquery--获取多选框的值、获取下拉多选框的值

    获取多选框的值 var packageCodeList=new Array(); $('#server_id:checked').each(function(){ packageCodeList.pu ...

  7. 自定义实现 PyQt5 下拉复选框 ComboCheckBox

    一.前言 由于最近的项目需要具有复选功能,但过多的复选框会影响界面布局和美观,因而想到把 PyQt5 的下拉列表和复选框结合起来,但在 PyQt5 中并没有这样的组件供我们使用,所以想要自己实现一个下 ...

  8. selectpicker下拉多选框ajax异步或者提前赋值=》默认值

    Bootstrap select多选下拉框赋值 success: function (data) { var oldnumber = new Array(); $.each(data, functio ...

  9. DevExpress下拉多选框 CheckComboboxEdit、CheckedListBoxControl

    CheckComboboxEdit //清空项            checkedComboBoxEdit1.Properties.Items.Clear(); //自定义数组            ...

随机推荐

  1. bzoj3105

    题解: 一道博弈论 题目要求取得最少,那么就是留下的最多 把石子从大到小排序 从打的开始刘 如果可以留,那么就留下了 如果留下了与前面留下来的异或后不为0,那么就可以留 代码: #include< ...

  2. 元素大小-偏移量(offset)客户区大小(client)滚动大小(scroll)

    一.偏移量---offset 1.定位父级 在理解偏移大小之前,首先要理解offsetParent.人们并没有把offsetParent翻译为偏移父级,而是翻译成定位父级,很大原因是offsetPar ...

  3. 去掉“Windows文件保护”

    1.在“开始→运行”对话框中键入“gpedit.msc”,打开“本地计算机策略→计算机配置→管理模板→系统”窗口,找到“Windows文件保护”组,在右侧窗格中双击“设置Windows文件保护扫描”项 ...

  4. Final阶段第1周/共1周 Scrum立会报告+燃尽图 02

    作业要求[https://edu.cnblogs.com/campus/nenu/2018fall/homework/2481] 版本控制:https://git.coding.net/liuyy08 ...

  5. centos下tomcat启动卡死

    遇到好几次了,总是忘记哪个位置~!!! tomcat启动时查看日志会卡在一个位置很长时间,如下 28-Aug-2018 22:56:55.216 INFO [localhost-startStop-1 ...

  6. Python 字典的增删改查

    dic = {"意大利": "李云龙","美国":"美国往事"} dic["日本"] = " ...

  7. 大数开根号java模板

    利用逼近的思路直接二分开方找出值 package lanqiao; import java.math.BigInteger; import java.util.Scanner; public clas ...

  8. uDig配图与GeoServer添加Style

    软件介绍: uDig是一个开源的桌面GIS软件,可以进行shp与栅格数据地图文件的编辑和查看,对OpenGIS标准,关于互联网GIS.网络地图服务器和网络功能服务器有特别的加强.通常和GeoServe ...

  9. Java中线程同步的方法

    同步方法 即有synchronized关键字修饰的方法. 由于java的每个对象都有一个内置锁,当用此关键字修饰方法时, 内置锁会保护整个方法.在调用该方法前,需要获得内置锁,否则就处于阻塞状态. 注 ...

  10. 统计学(检验、分布)的 python(numpy/pandas/scipy) 实现

    scipy 中统计相关的 api:https://docs.scipy.org/doc/scipy/reference/stats.html https://zhuanlan.zhihu.com/p/ ...