Extjs下拉多选框
//------录入时间,下拉列表框------
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下拉多选框的更多相关文章
- 我的第一个jquery插件:下拉多选框
<!DOCTYPE HTML> <html> <head> <title> New Document </title> <meta n ...
- 使用jQuery为文本框、单选框、多选框、下拉框、下拉多选框设值及返回值的处理
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/ ...
- angular2.x 下拉多选框选择组件
angular2.x - 5.x 的下拉多选框选择组件 ng2 -- ng5.最近在学angular4,经常在交流群看见很多人问 下拉多选怎么做... 今天就随便写的个. 组件源码 百度云 链接: ...
- 品优购商城项目(二)AngularJS、自动代码生成器、select2下拉多选框
品优购商城想项目第二阶段 AngularJS.自动代码生成器.select2下拉多选框 完成了课程第三天.第四天的的任务. 1.学习了AngularJs前端的mvc分层思想,js部分分成control ...
- 自己用ul模拟实现下拉多选框,
模拟实现下拉多选框 效果如下 <!DOCTYPE html> <html lang="en"> <head> <meta charset= ...
- jquery--获取多选框的值、获取下拉多选框的值
获取多选框的值 var packageCodeList=new Array(); $('#server_id:checked').each(function(){ packageCodeList.pu ...
- 自定义实现 PyQt5 下拉复选框 ComboCheckBox
一.前言 由于最近的项目需要具有复选功能,但过多的复选框会影响界面布局和美观,因而想到把 PyQt5 的下拉列表和复选框结合起来,但在 PyQt5 中并没有这样的组件供我们使用,所以想要自己实现一个下 ...
- selectpicker下拉多选框ajax异步或者提前赋值=》默认值
Bootstrap select多选下拉框赋值 success: function (data) { var oldnumber = new Array(); $.each(data, functio ...
- DevExpress下拉多选框 CheckComboboxEdit、CheckedListBoxControl
CheckComboboxEdit //清空项 checkedComboBoxEdit1.Properties.Items.Clear(); //自定义数组 ...
随机推荐
- javaweb web.xml版本
web.xml版本的xsd分为如下几个版本 web-app_2_2.xsd web-app_2_3.xsd web-app_2_4.xsd web-app_2_5.xsd .... web-app_3 ...
- Jquery中bind(), live(), on(), delegate()四种注册事件的优缺点,建议使用on()
jquery中注册的事件,注册事件很容易理解偏差,叫法不一样.我第一反应就是如何添加事件,使用onclick之类的,暂时不讨论js注册事件的方法. 也看到园内前辈写过相关的帖子,但不是很详细,我找到了 ...
- 返回最小的k个数
对于一个无序数组,数组中元素为互不相同的整数,请返回其中最小的k个数,顺序与原数组中元素顺序一致. 给定一个整数数组A及它的大小n,同时给定k,请返回其中最小的k个数. 测试样例: [1,2,4,3] ...
- sgu107. 987654321 problem 简单打表 难度:0
107. 987654321 problem time limit per test: 0.25 sec. memory limit per test: 4096 KB For given numbe ...
- .Net在线编辑器:KindEditor及CkEditor+CkFinder配置说明
Net在线编辑器:KindEditor及CkEditor+CkFinder配置说明 一.KindEditor(免费) KindEditor是一套开源的HTML可视化编辑器,主要用于让用户在网站上获得所 ...
- bzoj2463
题解: 当n为奇数,输出Bob 否则输出Alice 代码: #include<bits/stdc++.h> using namespace std; int n; int main() { ...
- pyinstaller又踩一坑, configparser os.mknod
在使用pyinstaller时,有使用configparser模块. 使用相对路径.在pycharm中测试,正常,打包成exe,就出错了 换用绝对路径, print(os.getcwd()) fp_d ...
- pyqt(二) 创建第一个程序(helloworld)解决object has no attribute 'setCentralWidget'
1.运行Qt Creator QtCreator主界面分为了6个模式:欢迎模式.编辑模式.设计模式.Debug调试模式.项目模式和帮助模式,分别由左侧的6个图标进行切换,对应的快捷键是Ctrl + 数 ...
- IE 11 回车事件代码不起作用但是在chrom可以正常运行解决办法
今天遇到这个问题,搞半天开始以为是代码写错了,后面拿到chrom上执行发现是正常的,就是这段代码 function EnterPress(){ if(event.keyCode == ...
- 配置total commander 显示所有或特定文件夹 (带点的文件夹)
在配置|忽略列表 下可以添加或删除需要隐藏的文件夹通配符.