- 浏览: 591900 次
- 性别:
- 来自: 西安
文章分类
- 全部博客 (365)
- Java 基础知识(笔试面试有用) (35)
- SQL 相关 (11)
- Oracle笔试 (1)
- Java 笔试面试 (11)
- LINUX (12)
- ExtJS (21)
- Javascript (17)
- WebGIS (2)
- 软件工程 (3)
- 数据库 (17)
- 项目管理 (63)
- 工作流 (2)
- 计算机网络 (3)
- ZigBee技术及应用 (24)
- 单片机(AVR Studio) (7)
- 项目人力资源管理 (3)
- 项目管理高级知识 (4)
- JAVA技术 (12)
- 项目管理中的概念 (3)
- SQL SERVER (1)
- C++ (1)
- C/C++编程经验 (12)
- C和C++面试笔试题 (12)
- 其他IT技术笔试面试 (6)
- 名企笔试面试集锦 (16)
- 非技术 (10)
- C#相关 (1)
- Matlab相关 (2)
- 计算机专业课相关 (2)
- Web Service (1)
- Excel 使用 (1)
- PhotoShop相关 (4)
- ASP 相关 (2)
- android (1)
- Java WEB 相关 (1)
- web 安全相关 (7)
- 网络安全 (1)
- IBatis (1)
- web 开发技巧 (2)
- css 相关 (1)
- Ruby相关 (2)
- 生活 (3)
- 操作系统安全相关 (6)
- 操作系统相关 (1)
- PHP相关 (3)
- 开发经验 (12)
- Redis (1)
最新评论
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>combox</title> <!-- ExtJS --> <link rel="stylesheet" type="text/css" href="EXTJS/resources/css/ext-all.css" /> <script type="text/javascript" src="EXTJS/bootstrap.js"></script> <!-- Example --> <script type="text/javascript"> Ext.onReady(function() { //json数据 var states = [ {"id":"1","name":"总经理"}, {"id":"2","name":"总监"}, {"id":"3","name":"经理"}, {"id":"3","name":"职员"} ]; //数据字段 Ext.regModel('State', { fields: [ {type: 'string', name: 'id'}, {type: 'string', name: 'name'} ] }); //创建数据源 var store = Ext.create('Ext.data.Store', { model: 'State', data: states }); //单选combox(不可编辑) var SingleCombox = Ext.create('Ext.form.field.ComboBox', { fieldLabel: '权限', //显示名 renderTo: 'SingleCombox', //对应ID displayField: 'name', //显示字段 width: 150, //combox宽 multiSelect:false, //是否多选 labelWidth: 35, //label长度 store: store, //数据源 queryMode: 'local', //最好设定queryMode为local,这样可以提高用户的响应速度 editable:false //是否可以编辑 }); //单选combox(可编辑) var SingleComboxEdit = Ext.create('Ext.form.field.ComboBox', { fieldLabel: '权限', renderTo: 'SingleComboxEdit', displayField: 'name', width: 150, multiSelect:false, labelWidth: 35, store: store, queryMode: 'local', editable:true }); //多选combox(不可编辑) var MultipleCombox=Ext.create('Ext.form.field.ComboBox',{ fieldLabel:'权限', renderTo:'MultipleCombox', displayField:'name', width:150, multiSelect:true, labelWidth:35, store: store, queryMode: 'local', editable:false }); //多选combox(可编辑) var MultipleComboxEdit=Ext.create('Ext.form.field.ComboBox',{ fieldLabel:'权限', renderTo:'MultipleComboxEdit', displayField:'name', width:150, multiSelect:true, labelWidth:35, store: store, queryMode: 'local', editable:true }); }); </script> </head> <body> <span>单选combox(不可编辑)</span><br/><div id="SingleCombox"></div><hr/> <span>单选combox(可编辑)</span><br/><div id="SingleComboxEdit"></div><hr/> <span>多选combox(不可编辑)</span><br/><div id="MultipleCombox"></div><hr/> <span>多选combox(可编辑)</span><br/><div id="MultipleComboxEdit"></div><hr/> </body> </html>
js 代码
- var combo = new Ext.form.ComboBox({
- store : new Ext.data.SimpleStore({
- fields : ['value', 'text'],
- data : [['1001', '小儿迪巧'], ['1002', '成人迪巧'], ['1003', '秀源']]
- }),
- hiddenName:'product_code',//提交到后台的input的name
- mode:'local',//数据加载模式,'local'本地加载,'remote'远程加载
- valueField : 'value', //值字段
- displayField : 'text', //显示字段
- value:'1001', //默认值,要设置为提交给后台的值,不要设置为显示文本
- emptyText : '请选择', //提示信息
- mode : 'local', //数据加载模式,local代表本地数据
- triggerAction : 'all', // 显示所有下列数据,一定要设置属性triggerAction为a
- readOnly : false, //只读,为true时不能编辑不能点击
- editable:false, //是否可编辑,为true时可以手写录入
- pageSize:0 //当设置大于0时会显示分页按钮
- })
如果在EditorGrid中使用Combo控件,编辑完后会发现显示的值都是编码而不是显示值,可以ColumnMode中加入renderer方法对显示值进行修改。下面是出自Combo源码里的例子。
js 代码
- Ext.util.Format.comboRenderer = function(combo){
- return function(value){
- var record = combo.findRecord(combo.{@link #valueField}, value);
- return record ? record.get(combo.{@link #displayField}) : combo.{@link #valueNotFoundText};
- }
- }
- // create the combo instance
- var combo = new Ext.form.ComboBox({
- {@link #typeAhead}: true,
- {@link #triggerAction}: 'all',
- {@link #lazyRender}:true,
- {@link #mode}: 'local',
- {@link #store}: new Ext.data.ArrayStore({
- id: 0,
- fields: [
- 'myId',
- 'displayText'
- ],
- data: [[1, 'item1'], [2, 'item2']]
- }),
- {@link #valueField}: 'myId',
- {@link #displayField}: 'displayText'
- });
- // snippet of column model used within grid
- var cm = new Ext.grid.ColumnModel([{
- ...
- },{
- header: "Some Header",
- dataIndex: 'whatever',
- width: 130,
- editor: combo, // specify reference to combo instance
- renderer: Ext.util.Format.comboRenderer(combo) // pass combo instance to reusable renderer
- },
- ...
- ]);
发表评论
-
ExtJS 中在不同浏览器下显示字体不一样问题
2012-12-23 21:11 711在你使用ExtUI的html页面里加上: -
ExtJS Store 方法以及属性介绍
2012-12-13 10:07 1060store是一个为Ext器件提供record对象的存储容器,行 ... -
Ext 中 得到grid 中 store 中某行的某个单元格的值
2012-12-13 09:56 805var record=grid.getStore.get ... -
new Ext.grid.GridPanel render
2012-12-12 18:25 1762function renderDescn(val ... -
Uncaught TypeError: Cannot call method 'getTotalWidth' of undefined
2012-12-10 20:13 1346什么问题了?解决了不? -
ExtJs button 居中
2012-12-07 17:50 14237var win = new Ext.Window({ ... -
iframe 的使用
2012-08-01 13:25 789new Ext.Panel({ ... -
ext groupingStroe 使用注意问题
2011-09-12 11:38 848// shared reader var re ... -
this.ds is undefined ext gird
2011-05-09 09:22 1562this.ds is undefined ext-all.js ... -
Ext.get(id).on('click', function(e){
2011-04-15 10:07 1447Ext.get(id).on('click', functio ... -
pagingBar a is undefined
2009-11-17 23:19 1103当pagingBar中没有定义store的时候,firefox ... -
ext 中的各个style
2009-11-17 19:59 1252总结一下最近所学的到的东西: baseCls : ... -
ext iconCls
2009-11-17 19:36 2057ext 中 iconCls:'nav', 表示的意思就是,在马 ... -
ext 动态修改iframe 的src
2009-11-17 19:18 3401new Ext.TabPanel({ ... -
网站在IE和Firefox中的字体显示问题
2009-11-15 22:53 969最近用Ext做了个小网站,在IE里显示的很好,字体都正常,但是 ... -
a[c.xtype || d] is not a constructor ext-all.js(第9行)
2009-11-15 21:31 1570总报这个错误。这不知道到底是什么原因 -
b is undefined 第9行
2009-11-15 21:17 2112在以下这种情况下会导致这种错误。定义了autoLoad:tru ... -
ext 得到 j已定义id的元素
2009-11-15 20:33 970用Ext.getCmp(‘')即可得到进行操作。 例如 ... -
TabPanel autoLoad 乱码解决问题
2009-11-15 20:26 999看 代码一: new Ext.TabPanel({ ... -
动态修改TabPanel的html(1)
2009-11-15 20:11 3928Ext.TabPanel中的items中可以写html来调用 ...
相关推荐
1. Ext.form.NumberField 2. Ext.form.TextArea 3. Ext.form.TriggerField 4. Ext.form.DateField 5. Ext.form.ComboBox 6. Ext.form.TimeField
Ext.form.field.ComboBox结合Java、JSON实现AutoComplete
用EXT来实现下拉框ComboBox 下拉框可以实现分页
53、Ext.form.DateField类 ………… 45 54、Ext.form.ComboBox类 ……………… 46 55、Ext.form.TimeField类 ………… 47 56、Ext.menu.Menu类 ………………… 50 57、Ext.menu.BaseItem类 …………… 50 58、Ext....
NULL 博文链接:https://leonel.iteye.com/blog/454174
4.1.12 Ext.form.field.ComboBox组合框 4.1.13 Ext.form.field.Time时间选择框 4.1.14 Ext.form.field.Date日期选择框 4.1.15 Ext.form.field.Hidden隐藏字段 4.1.16 Ext.form.field.HtmlEditor编辑器字段 ...
53、Ext.form.DateField类 ………… 45 54、Ext.form.ComboBox类 ……………… 46 55、Ext.form.TimeField类 ………… 47 56、Ext.menu.Menu类 ………………… 50 57、Ext.menu.BaseItem类 …………… 50 58、Ext....
ext关于form表单和combobox的例子
9.2.2 ext.container.abstractcontainer和ext.container.container的配置项、属性、方法和事件 / 434 9.2.3 将body元素作为容器:ext.container.viewport / 435 9.3 面板 / 436 9.3.1 面板的结构 / 436 9.3.2 ...
extjs editgrid combobox 回显extjs editgrid combobox 回显extjs editgrid combobox 回显extjs editgrid combobox 回显
var fm = Ext.form; //构造一个只能包含checkbox的列 var checkColumn = new Ext.grid.CheckColumn({ header: 'Indoor?', dataIndex: 'indoor', width: 55 }); // 构造ColumnModel var cm = new Ext....
首先在窗体中添加一个comboBox1和一个imageList(本例中带有三个图片) this.comboBox1.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
ext,ext combobox,ext二级联动,ext combobox二级联动 ___本人的原则:上传好东西,但绝不便宜.因为自己的心血 ext combobox二级联动,ext ,ext combobox,combobox,combobox二级联动,ext 二级联动 groupCombo.on('...
Extjs4下拉树菜单 ComboBoxTree 支持单选和多选并且支持展开选中指定节点的通用控件 在项目中已经成熟运用 值得收藏和运用
new Ext.form.ComboBox({ store: new Ext.data.JsonStore({ idProperty: 'VehicleNo', url: '../ajax/test.ashx, fields: ['VehicleNo', 'phoneNum'] }), id:'querynodesid', emptyText:'快速检索', ...
VB api编程模块ComboBox输入设计代码VB api code programming model ComboBox input design
资源无,ComboBox
在CDH使用oozie 的时候需要安装ext-2.2.zip; 新增和改进的功能包括: 1、FileUploadField 文件上传 体验例子见:...Ext.form.ComboBox 的样式就很漂亮!
在PropertyGrid中使用Combobox来选择值时,得到的应该是displayField的值,但是在确认选择的时候却显示了valueField的值
VB编程ComboBox列表框实例设计代码VB ComboBox list box design example programming code