- 浏览: 2312645 次
- 性别:
- 来自: 北京
-
文章分类
- 全部博客 (314)
- JAVA基础知识 (54)
- Java-IO/FIle (16)
- Java-JDBC (4)
- JAVA-新增特性-注解 (3)
- Java-枚举 (2)
- Java-泛型 (1)
- Java-多线程 (15)
- Java-XML (4)
- Java-JMS(消息服务) (4)
- Java-JVM (0)
- Web Service服务 (7)
- Jsp (10)
- js (18)
- Struts框架 (11)
- Spring框架 (29)
- Hibernate框架 (28)
- Spring Boot框架 (2)
- ExtJS前端框架 (29)
- Jquery js库 (8)
- JUnit框架 (8)
- Selenium 测试 (1)
- NoSql---Redis (6)
- ORACLE数据库 (45)
- MySQL数据库 (4)
- tomcat (3)
- Nginx反向代理服务器 (4)
- web应用服务器通用知识 (3)
- 开发工具IDE (14)
- UML建模 (1)
- SVN CVS 版本管理 (6)
- git 分布式版本管理 (4)
- 报表设计 (5)
- 文件上传下载 (2)
- 数据算法 (1)
- 存储过程 (5)
- JSON 相关 (1)
- OGNL表达式 (3)
- Util工具包 (9)
- 设计模式 (15)
- linux 相关 (3)
- life think (3)
- 工作流管理框架 (1)
- 大数据-Hadoop (1)
最新评论
-
huih:
很不错的文章
SpringMVC+Hibernate+Spring 简单的一个整合实例 -
calm01:
学习了.
Spring <bean>标签属性 Autowire自动装配(转载) -
lizhenlzlz:
我的也是拦截不了service层
SpringAOP拦截Controller,Service实现日志管理(自定义注解的方式)(转载) -
josh_123:
讲的不错,很详细,如果quartz定时任务类采用不继承任何类的 ...
Spring,jdk定时任务的几种实现以及任务线程是串行还是并行执行(转载) -
human_coder:
你知道eclipse调试怎么可以回调吗?有时候总是调快了,不能 ...
Debug---Eclipse断点调试基础
下面介绍MultiComboBox的使用方式,大家先看看下面的代码:
Java代码
- Ext.onReady(function(){
- var formPanel = new Ext.FormPanel({
- height : 100,// 表单面板的高度
- width : 400,// 表单面板的宽度
- labelWidth : 120,// 字段标签宽度
- labelAlign : "right",// 字段标签对齐方式
- fileUpload: true,//支持文件上传
- defaults : {// 默认form元素类型为textfield
- xtype : "textfield",// 默认类型为textfield
- width : 150 // 默认宽度
- },
- items : [{
- xtype:'multicombo',
- width:250,
- store: new Ext.data.SimpleStore({
- fields: ["name","value"],
- data:[['测试菜单1',1],['测试菜单2',2],['测试菜单3',3],['测试菜单4',4]]}),
- valueField :"value",
- displayField: "name",
- labelSeparator:':',
- displaySeparator:';',
- valueSeparator:',',
- mode: 'local',
- value:'1,2',
- forceSelection: true,
- hiddenName:'test',
- editable: true,
- triggerAction: 'all',
- allowBlank:false,
- emptyText:'请选择',
- fieldLabel: '多选下拉ComBo'
- }],
- buttons : [{
- text : '提交',
- type : 'submit',
- handler : function() {
- }
- }]
- });
- formPanel.render("multicombo-div");
- });
- <span class="hilite1">Ext</span>
- .onReady(function(){
- var formPanel = new <span class="hilite1">Ext</span>
- .FormPanel({
- height : 100,// 表单面板的高度
- width : 400,// 表单面板的宽度
- labelWidth : 120,// 字段标签宽度
- labelAlign : "right",// 字段标签对齐方式
- fileUpload: true,//支持文件上传
- defaults : {// 默认form元素类型为textfield
- xtype : "textfield",// 默认类型为textfield
- width : 150 // 默认宽度
- },
- items : [{
- xtype:'multicombo',
- width:250,
- store: new <span class="hilite1">Ext</span>
- .data.SimpleStore({
- fields: ["name","value"],
- data:[['测试菜单1',1],['测试菜单2',2],['测试菜单3',3],['测试菜单4',4]]}),
- valueField :"value",
- displayField: "name",
- labelSeparator:':',
- displaySeparator:';',
- valueSeparator:',',
- mode: 'local',
- value:'1,2',
- forceSelection: true,
- hiddenName:'test',
- editable: true,
- triggerAction: 'all',
- allowBlank:false,
- emptyText:'请选择',
- fieldLabel: '多选下拉ComBo'
- }],
- buttons : [{
- text : '提交',
- type : 'submit',
- handler : function() {
- }
- }]
- });
- formPanel.render("multicombo-div");
- });
Ext
.onReady(function(){
var formPanel = new Ext
.FormPanel({
height : 100,// 表单面板的高度
width : 400,// 表单面板的宽度
labelWidth : 120,// 字段标签宽度
labelAlign : "right",// 字段标签对齐方式
fileUpload: true,//支持文件上传
defaults : {// 默认form元素类型为textfield
xtype : "textfield",// 默认类型为textfield
width : 150 // 默认宽度
},
items : [{
xtype:'multicombo',
width:250,
store: new Ext
.data.SimpleStore({
fields: ["name","value"],
data:[['测试菜单1',1],['测试菜单2',2],['测试菜单3',3],['测试菜单4',4]]}),
valueField :"value",
displayField: "name",
labelSeparator:':',
displaySeparator:';',
valueSeparator:',',
mode: 'local',
value:'1,2',
forceSelection: true,
hiddenName:'test',
editable: true,
triggerAction: 'all',
allowBlank:false,
emptyText:'请选择',
fieldLabel: '多选下拉ComBo'
}],
buttons : [{
text : '提交',
type : 'submit',
handler : function() {
}
}]
});
formPanel.render("multicombo-div");
});
由上面代码可以看到用法大致和ComboBox一样,不相同的地方是:
Java代码
- xtype:'multicombo',//MultiComboBox注册类型名称
- displaySeparator:';',//多选显示分隔字符
- valueSeparator:',',//多选提交到后台的值分隔符
- value:'1,2',// 多值通过","分隔,与valueSeparator相对应,表示默认选择了"测试菜单1'"和"测试菜单2"
- xtype:'multicombo',//MultiComboBox注册类型名称
- displaySeparator:';',//多选显示分隔字符
- valueSeparator:',',//多选提交到后台的值分隔符
- value:'1,2',// 多值通过","分隔,与valueSeparator相对应,表示默认选择了"测试菜单1'"和"测试菜单2"
xtype:'multicombo',//MultiComboBox注册类型名称
displaySeparator:';',//多选显示分隔字符
valueSeparator:',',//多选提交到后台的值分隔符
value:'1,2',// 多值通过","分隔,与valueSeparator相对应,表示默认选择了"测试菜单1'"和"测试菜单2"
由于添加了多选CheckBox图标,所以需要在ext-all.css文件最后添加两行支持样式:
Java代码
- .checked{background-image:url(../images/default/menu/checked.gif)}
- .unchecked{background-image:url(../images/default/menu/unchecked.gif)}
- .checked{background-image:url(../images/default/menu/checked.gif)}
- .unchecked{background-image:url(../images/default/menu/unchecked.gif)}
.checked{background-image:url(../images/default/menu/checked.gif)}
.unchecked{background-image:url(../images/default/menu/unchecked.gif)}
MultiComboBox的源代码:
Java代码
- Ext.form.MultiComboBox = Ext.extend(Ext.form.TriggerField, {
- defaultAutoCreate : {tag: "input", type: "text", size: "24", autocomplete: "off"},
- listClass: '',
- selectedClass: 'x-combo-selected',
- triggerClass : 'x-form-arrow-trigger',
- shadow:'sides',
- listAlign: 'tl-bl?',
- maxHeight: 300,
- triggerAction: 'query',
- minChars : 4,
- typeAhead: false,
- queryDelay: 500,
- pageSize: 0,
- selectOnFocus:false,
- queryParam: 'query',
- loadingText: 'Loading...',
- resizable: false,
- handleHeight : 8,
- editable: true,
- allQuery: '',
- mode: 'remote',
- minListWidth : 70,
- forceSelection:false,
- typeAheadDelay : 250,
- displaySeparator:';',
- valueSeparator:',',
- lazyInit : true,
- initComponent : function(){
- Ext.form.ComboBox.superclass.initComponent.call(this);
- this.addEvents(
- 'expand',
- 'collapse',
- 'beforeselect',
- 'select',
- 'beforequery'
- );
- if(this.transform){
- this.allowDomMove = false;
- var s = Ext.getDom(this.transform);
- if(!this.hiddenName){
- this.hiddenName = s.name;
- }
- if(!this.store){
- this.mode = 'local';
- var d = [], opts = s.options;
- for(var i = 0, len = opts.length;i < len; i++){
- var o = opts[i];
- var value = (Ext.isIE ? o.getAttributeNode('value').specified : o.hasAttribute('value')) ? o.value : o.text;
- if(o.selected) {
- this.value = value;
- }
- d.push([value, o.text]);
- }
- this.store = new Ext.data.SimpleStore({
- 'id': 0,
- fields: ['value', 'text'],
- data : d
- });
- this.valueField = 'value';
- this.displayField = 'text';
- }
- s.name = Ext.id(); // wipe out the name in case somewhere else they have a reference
- if(!this.lazyRender){
- this.target = true;
- this.el = Ext.DomHelper.insertBefore(s, this.autoCreate || this.defaultAutoCreate);
- Ext.removeNode(s); // remove it
- this.render(this.el.parentNode);
- }else{
- Ext.removeNode(s); // remove it
- }
- }
- this.selectedIndex = -1;
- if(this.mode == 'local'){
- if(this.initialConfig.queryDelay === undefined){
- this.queryDelay = 10;
- }
- if(this.initialConfig.minChars === undefined){
- this.minChars = 0;
- }
- }
- },
- // private
- onRender : function(ct, position){
- Ext.form.ComboBox.superclass.onRender.call(this, ct, position);
- var disValue="";
- if(this.hiddenName){
- this.hiddenField = this.el.insertSibling({tag:'input', type:'hidden', name: this.hiddenName, id: (this.hiddenId||this.hiddenName)},
- 'before', true);
- var hvalue=this.hiddenValue !== undefined ? this.hiddenValue :
- this.value !== undefined ? this.value : '';
- var hvalueArray=hvalue.split(this.valueSeparator);
- for(var i=0;i<this.store.data.length;i++){
- var r = this.store.getAt(i);
- var newValue = r.data[this.displayField];
- var v=r.data[this.valueField];
- for(var j=0;j<hvalueArray.length;j++){
- if(hvalueArray[j]==v){
- disValue+=newValue+this.displaySeparator;
- }
- }
- }
- this.hiddenField.value =this.hiddenValue !== undefined ? this.hiddenValue :
- this.value !== undefined ? this.value : '';
- this.el.dom.removeAttribute('name');
- }
- if(Ext.isGecko){
- this.el.dom.setAttribute('autocomplete', 'off');
- }
- if(!this.lazyInit){
- this.initList();
- }else{
- this.on('focus', this.initList, this, {single: true});
- }
- if(!this.editable){
- this.editable = true;
- this.setEditable(false);
- }
- this.setValue(disValue);
- },
- initList : function(){
- if(!this.list){
- var cls = 'x-combo-list';
- this.list = new Ext.Layer({
- shadow: this.shadow, cls: [cls, this.listClass].join(' '), constrain:false
- });
- var lw = this.listWidth || Math.max(this.wrap.getWidth(), this.minListWidth);
- this.list.setWidth(lw);
- this.list.swallowEvent('mousewheel');
- this.assetHeight = 0;
- if(this.title){
- this.header = this.list.createChild({cls:cls+'-hd', html: this.title});
- this.assetHeight += this.header.getHeight();
- }
- this.innerList = this.list.createChild({cls:cls+'-inner'});
- this.innerList.on('mouseover', this.onViewOver, this);
- this.innerList.on('mousemove', this.onViewMove, this);
- this.innerList.setWidth(lw - this.list.getFrameWidth('lr'))
- if(this.pageSize){
- this.footer = this.list.createChild({cls:cls+'-ft'});
- this.pageTb = new Ext.PagingToolbar({
- store:this.store,
- pageSize: this.pageSize,
- renderTo:this.footer
- });
- this.assetHeight += this.footer.getHeight();
- }
- if(!this.tpl){
- //alert(cls);
- //x-combo-list-item
- this.tpl = '<tpl for="."><div class="'+cls+'-item"><span class="unchecked" id="checkBox_{' + this.displayField + '}"+ width="20"> </span>{' + this.displayField + '}</div></tpl>';
- }
- this.view = new Ext.DataView({
- applyTo: this.innerList,
- tpl: this.tpl,
- singleSelect: true,
- selectedClass: this.selectedClass,
- itemSelector: this.itemSelector || '.' + cls + '-item'
- });
- this.view.on('click', this.onViewClick, this);
- this.bindStore(this.store, true);
- if(this.resizable){
- this.resizer = new Ext.Resizable(this.list, {
- pinned:true, handles:'se'
- });
- this.resizer.on('resize', function(r, w, h){
- this.maxHeight = h-this.handleHeight-this.list.getFrameWidth('tb')-this.assetHeight;
- this.listWidth = w;
- this.innerList.setWidth(w - this.list.getFrameWidth('lr'));
- this.restrictHeight();
- }, this);
- this[this.pageSize?'footer':'innerList'].setStyle('margin-bottom', this.handleHeight+'px');
- }
- }
- },
- bindStore : function(store, initial){
- if(this.store && !initial){
- this.store.un('beforeload', this.onBeforeLoad, this);
- this.store.un('load', this.onLoad, this);
- this.store.un('loadexception', this.collapse, this);
- if(!store){
- this.store = null;
- if(this.view){
- this.view.setStore(null);
- }
- }
- }
- if(store){
- this.store = Ext.StoreMgr.lookup(store);
- this.store.on('beforeload', this.onBeforeLoad, this);
- this.store.on('load', this.onLoad, this);
- this.store.on('loadexception', this.collapse, this);
- if(this.view){
- this.view.setStore(store);
- }
- }
- },
- // private
- initEvents : function(){
- Ext.form.ComboBox.superclass.initEvents.call(this);
- this.keyNav = new Ext.KeyNav(this.el, {
- "up" : function(e){
- this.inKeyMode = true;
- this.selectPrev();
- },
- "down" : function(e){
- if(!this.isExpanded()){
- this.onTriggerClick();
- }else{
- this.inKeyMode = true;
- this.selectNext();
- }
- },
- "enter" : function(e){
- this.onViewClick();
- //return true;
- },
- "esc" : function(e){
- this.collapse();
- },
- "tab" : function(e){
- this.onViewClick(false);
- return true;
- },
- scope : this,
- doRelay : function(foo, bar, hname){
- if(hname == 'down' || this.scope.isExpanded()){
- return Ext.KeyNav.prototype.doRelay.apply(this, arguments);
- }
- return true;
- },
- forceKeyDown : true
- });
- this.queryDelay = Math.max(this.queryDelay || 10,
- this.mode == 'local' ? 10 : 250);
- this.dqTask = new Ext.util.DelayedTask(this.initQuery, this);
- if(this.typeAhead){
- this.taTask = new Ext.util.DelayedTask(this.onTypeAhead, this);
- }
- if(this.editable !== false){
- this.el.on("keyup", this.onKeyUp, this);
- }
- if(this.forceSelection){
- this.on('blur', this.doForce, this);
- }
- },
- onDestroy : function(){
- if(this.view){
- this.view.el.removeAllListeners();
- this.view.el.remove();
- this.view.purgeListeners();
- }
- if(this.list){
- this.list.destroy();
- }
- this.bindStore(null);
- Ext.form.ComboBox.superclass.onDestroy.call(this);
- },
- // private
- fireKey : function(e){
- if(e.isNavKeyPress() && !this.list.isVisible()){
- this.fireEvent("specialkey", this, e);
- }
- },
- // private
- onResize: function(w, h){
- Ext.form.ComboBox.superclass.onResize.apply(this, arguments);
- if(this.list && this.listWidth === undefined){
- var lw = Math.max(w, this.minListWidth);
- this.list.setWidth(lw);
- this.innerList.setWidth(lw - this.list.getFrameWidth('lr'));
- }
- },
- // private
- onDisable: function(){
- Ext.form.ComboBox.superclass.onDisable.apply(this, arguments);
- if(this.hiddenField){
- this.hiddenField.disabled = this.disabled;
- }
- },
- setEditable : function(value){
- if(value == this.editable){
- return;
- }
- this.editable = value;
- if(!value){
- this.el.dom.setAttribute('readOnly', true);
- this.el.on('mousedown', this.onTriggerClick, this);
- this.el.addClass('x-combo-noedit');
- }else{
- this.el.dom.setAttribute('readOnly', false);
- this.el.un('mousedown', this.onTriggerClick, this);
- this.el.removeClass('x-combo-noedit');
- }
- },
- // private
- onBeforeLoad : function(){
- if(!this.hasFocus){
- return;
- }
- this.innerList.update(this.loadingText ?
- '<div class="loading-indicator">'+this.loadingText+'</div>' : '');
- this.restrictHeight();
- this.selectedIndex = -1;
- },
- // private
- onLoad : function(){
- if(!this.hasFocus){
- return;
- }
- if(this.store.getCount() > 0){
- this.expand();
- this.restrictHeight();
- if(this.lastQuery == this.allQuery){
- if(this.editable){
- this.el.dom.select();
- }
- if(!this.selectByValue(this.value, true)){
- this.select(0, true);
- }
- }else{
- this.selectNext();
- if(this.typeAhead && this.lastKey != Ext.EventObject.BACKSPACE && this.lastKey != Ext.EventObject.DELETE){
- this.taTask.delay(this.typeAheadDelay);
- }
- }
- }else{
- this.onEmptyResults();
- }
- },
- // private
- onTypeAhead : function(){
- if(this.store.getCount() > 0){
- var r = this.store.getAt(0);
- var newValue = r.data[this.displayField];
- var len = newValue.length;
- var selStart = this.getRawValue().length;
- if(selStart != len){
- this.setRawValue(newValue);
- this.selectText(selStart, newValue.length);
- }
- }
- },
- // private
- onSelect : function(record, index){
- if(this.fireEvent('beforeselect', this, record, index) !== false){
- var r = this.store.getAt(index);
- var newValue = r.data[this.displayField];
- var check=document.getElementById("checkBox_"+newValue);
- if(check.className=="checked"){
- check.className="unchecked"
- }else{
- check.className="checked"
- }
- var value="";
- var hiddenValue="";
- for(var i=0;i<this.store.data.length;i++){
- var r = this.store.getAt(i);
- newValue = r.data[this.displayField];
- check=document.getElementById("checkBox_"+newValue);
- if(check.className=="checked"){
- value+= r.data[this.displayField]+this.displaySeparator;
- hiddenValue+= r.data[this.valueField]+this.valueSeparator;
- }
- }
- if(value.length>1){
- value=value.substring(0,value.length-this.displaySeparator.length);
- }
- if(hiddenValue.length>1){
- hiddenValue=hiddenValue.substring(0,value.length-this.valueSeparator.length);
- }
- this.setValue(value);
- this.hiddenField.value=hiddenValue;
- this.fireEvent('select', this, record, index);
- }
- },
- getValue : function(){
- if(this.valueField){
- return typeof this.value != 'undefined' ? this.value : '';
- }else{
- return Ext.form.ComboBox.superclass.getValue.call(this);
- }
- },
- /**
- * Clears any text/value currently set in the field
- */
- clearValue : function(){
- if(this.hiddenField){
- this.hiddenField.value = '';
- }
- this.setRawValue('');
- this.lastSelectionText = '';
- this.applyEmptyText();
- },
- setValue : function(v){
- var text = v;
- if(this.valueField){
- var r = this.findRecord(this.valueField, v);
- if(r){
- text = r.data[this.displayField];
- }else if(this.valueNotFoundText !== undefined){
- text = this.valueNotFoundText;
- }
- }
- this.lastSelectionText = text;
- Ext.form.ComboBox.superclass.setValue.call(this, text);
- this.value = v;
- },
- // private
- findRecord : function(prop, value){
- var record;
- if(this.store.getCount() > 0){
- this.store.each(function(r){
- if(r.data[prop] == value){
- record = r;
- return false;
- }
- });
- }
- return record;
- },
- // private
- onViewMove : function(e, t){
- this.inKeyMode = false;
- },
- // private
- onViewOver : function(e, t){
- if(this.inKeyMode){ // prevent key nav and mouse over conflicts
- return;
- }
- var item = this.view.findItemFromChild(t);
- if(item){
- var index = this.view.indexOf(item);
- this.select(index, false);
- }
- },
- // private
- onViewClick : function(doFocus){
- var index = this.view.getSelectedIndexes()[0];
- var r = this.store.getAt(index);
- if(r){
- this.onSelect(r, index);
- }
- if(doFocus !== false){
- this.el.focus();
- }
- },
- // private
- restrictHeight : function(){
- this.innerList.dom.style.height = '';
- var inner = this.innerList.dom;
- var fw = this.list.getFrameWidth('tb');
- var h = Math.max(inner.clientHeight, inner.offsetHeight, inner.scrollHeight);
- this.innerList.setHeight(h < this.maxHeight ? 'auto' : this.maxHeight);
- this.list.beginUpdate();
- this.list.setHeight(this.innerList.getHeight()+fw+(this.resizable?this.handleHeight:0)+this.assetHeight);
- this.list.alignTo(this.el, this.listAlign);
- this.list.endUpdate();
- },
- // private
- onEmptyResults : function(){
- this.collapse();
- },
- /**
- * Returns true if the dropdown list is expanded, else false.
- */
- isExpanded : function(){
- return this.list && this.list.isVisible();
- },
- selectByValue : function(v, scrollIntoView){
- if(v !== undefined && v !== null){
- var r = this.findRecord(this.valueField || this.displayField, v);
- if(r){
- this.select(this.store.indexOf(r), scrollIntoView);
- return true;
- }
- }
- return false;
- },
- select : function(index, scrollIntoView){
- this.selectedIndex = index;
- this.view.select(index);
- if(scrollIntoView !== false){
- var el = this.view.getNode(index);
- if(el){
- this.innerList.scrollChildIntoView(el, false);
- }
- }
- },
- // private
- selectNext : function(){
- var ct = this.store.getCount();
- if(ct > 0){
- if(this.selectedIndex == -1){
- this.select(0);
- }else if(this.selectedIndex < ct-1){
- this.select(this.selectedIndex+1);
- }
- }
- },
- // private
- selectPrev : function(){
- var ct = this.store.getCount();
- if(ct > 0){
- if(this.selectedIndex == -1){
- this.select(0);
- }else if(this.selectedIndex != 0){
- this.select(this.selectedIndex-1);
- }
- }
- },
- // private
- onKeyUp : function(e){
- if(this.editable !== false && !e.isSpecialKey()){
- this.lastKey = e.getKey();
- this.dqTask.delay(this.queryDelay);
- }
- },
- // private
- validateBlur : function(){
- return !this.list || !this.list.isVisible();
- },
- // private
- initQuery : function(){
- this.doQuery(this.getRawValue());
- },
- // private
- doForce : function(){
- if(this.el.dom.value.length > 0){
- this.el.dom.value =
- this.lastSelectionText === undefined ? '' : this.lastSelectionText;
- this.applyEmptyText();
- }
- },
- doQuery : function(q, forceAll){
- if(q === undefined || q === null){
- q = '';
- }
- var qe = {
- query: q,
- forceAll: forceAll,
- combo: this,
- cancel:false
- };
- if(this.fireEvent('beforequery', qe)===false || qe.cancel){
- return false;
- }
- q = qe.query;
- forceAll = qe.forceAll;
- if(forceAll === true || (q.length >= this.minChars)){
- if(this.lastQuery !== q){
- this.lastQuery = q;
- if(this.mode == 'local'){
- this.selectedIndex = -1;
- if(forceAll){
- this.store.clearFilter();
- }else{
- this.store.filter(this.displayField, q);
- }
- this.onLoad();
- }else{
- this.store.baseParams[this.queryParam] = q;
- this.store.load({
- params: this.getParams(q)
- });
- this.expand();
- }
- }else{
- this.selectedIndex = -1;
- this.onLoad();
- }
- }
- },
- // private
- getParams : function(q){
- var p = {};
- //p[this.queryParam] = q;
- if(this.pageSize){
- p.start = 0;
- p.limit = this.pageSize;
- }
- return p;
- },
- /**
- * Hides the dropdown list if it is currently expanded. Fires the 'collapse' event on completion.
- */
- collapse : function(){
- if(!this.isExpanded()){
- return;
- }
- this.list.hide();
- Ext.getDoc().un('mousewheel', this.collapseIf, this);
- Ext.getDoc().un('mousedown', this.collapseIf, this);
- this.fireEvent('collapse', this);
- },
- // private
- collapseIf : function(e){
- if(!e.within(this.wrap) && !e.within(this.list)){
- this.collapse();
- }
- },
- /**
- * Expands the dropdown list if it is currently hidden. Fires the 'expand' event on completion.
- */
- expand : function(){
- if(this.isExpanded() || !this.hasFocus){
- return;
- }
- this.list.alignTo(this.wrap, this.listAlign);
- var hvalueArray=this.hiddenField.value.split(this.valueSeparator);
- for(var i=0;i<this.store.data.length;i++){
- var r = this.store.getAt(i);
- var newValue = r.data[this.displayField];
- var v=r.data[this.valueField];
- for(var j=0;j<hvalueArray.length;j++){
- if(hvalueArray[j]==v){
- document.getElementById("checkBox_"+newValue).className="checked";
- }
- }
- }
- this.list.show();
- Ext.getDoc().on('mousewheel', this.collapseIf, this);
- Ext.getDoc().on('mousedown', this.collapseIf, this);
- this.fireEvent('expand', this);
- },
- // private
- // Implements the default empty TriggerField.onTriggerClick function
- onTriggerClick : function(){
- if(this.disabled){
- return;
- }
- if(this.isExpanded()){
- this.collapse();
- this.el.focus();
- }else {
- this.onFocus({});
- if(this.triggerAction == 'all') {
- this.doQuery(this.allQuery, true);
- } else {
- this.doQuery(this.getRawValue());
- }
- this.el.focus();
- }
- }
- });
- Ext.reg('multicombo', Ext.form.MultiComboBox);
- <span class="hilite1">Ext</span>
- .form.MultiComboBox = <span class="hilite1">Ext</span>
- .extend(<span class="hilite1">Ext</span>
- .form.TriggerField, {
- defaultAutoCreate : {tag: "input", type: "text", size: "24", autocomplete: "off"},
- listClass: '',
- selectedClass: 'x-combo-selected',
- triggerClass : 'x-form-arrow-trigger',
- shadow:'sides',
- listAlign: 'tl-bl?',
- maxHeight: 300,
- triggerAction: 'query',
- minChars : 4,
- typeAhead: false,
- queryDelay: 500,
- pageSize: 0,
- selectOnFocus:false,
- queryParam: 'query',
- loadingText: 'Loading...',
- resizable: false,
- handleHeight : 8,
- editable: true,
- allQuery: '',
- mode: 'remote',
- minListWidth : 70,
- forceSelection:false,
- typeAheadDelay : 250,
- displaySeparator:';',
- valueSeparator:',',
- lazyInit : true,
- initComponent : function(){
- <span class="hilite1">Ext</span>
- .form.ComboBox.superclass.initComponent.call(this);
- this.addEvents(
- 'expand',
- 'collapse',
- 'beforeselect',
- 'select',
- 'beforequery'
- );
- if(this.transform){
- this.allowDomMove = false;
- var s = <span class="hilite1">Ext</span>
- .getDom(this.transform);
- if(!this.hiddenName){
- this.hiddenName = s.name;
- }
- if(!this.store){
- this.mode = 'local';
- var d = [], opts = s.options;
- for(var i = 0, len = opts.length;i < len; i++){
- var o = opts[i];
- var value = (<span class="hilite1">Ext</span>
- .isIE ? o.getAttributeNode('value').specified : o.hasAttribute('value')) ? o.value : o.text;
- if(o.selected) {
- this.value = value;
- }
- d.push([value, o.text]);
- }
- this.store = new <span class="hilite1">Ext</span>
- .data.SimpleStore({
- 'id': 0,
- fields: ['value', 'text'],
- data : d
- });
- this.valueField = 'value';
- this.displayField = 'text';
- }
- s.name = <span class="hilite1">Ext</span>
- .id(); // wipe out the name in case somewhere else they have a reference
- if(!this.lazyRender){
- this.target = true;
- this.el = <span class="hilite1">Ext</span>
- .DomHelper.insertBefore(s, this.autoCreate || this.defaultAutoCreate);
- <span class="hilite1">Ext</span>
- .removeNode(s); // remove it
- this.render(this.el.parentNode);
- }else{
- <span class="hilite1">Ext</span>
- .removeNode(s); // remove it
- }
- }
- this.selectedIndex = -1;
- if(this.mode == 'local'){
- if(this.initialConfig.queryDelay === undefined){
- this.queryDelay = 10;
- }
- if(this.initialConfig.minChars === undefined){
- this.minChars = 0;
- }
- }
- },
- // private
- onRender : function(ct, position){
- <span class="hilite1">Ext</span>
- .form.ComboBox.superclass.onRender.call(this, ct, position);
- var disValue="";
- if(this.hiddenName){
- this.hiddenField = this.el.insertSibling({tag:'input', type:'hidden', name: this.hiddenName, id: (this.hiddenId||this.hiddenName)},
- 'before', true);
- var hvalue=this.hiddenValue !== undefined ? this.hiddenValue :
- this.value !== undefined ? this.value : '';
- var hvalueArray=hvalue.split(this.valueSeparator);
- for(var i=0;i<this.store.data.length;i++){
- var r = this.store.getAt(i);
- var newValue = r.data[this.displayField];
- var v=r.data[this.valueField];
- for(var j=0;j<hvalueArray.length;j++){
- if(hvalueArray[j]==v){
- disValue+=newValue+this.displaySeparator;
- }
- }
- }
- this.hiddenField.value =this.hiddenValue !== undefined ? this.hiddenValue :
- this.value !== undefined ? this.value : '';
- this.el.dom.removeAttribute('name');
- }
- if(<span class="hilite1">Ext</span>
- .isGecko){
- this.el.dom.setAttribute('autocomplete', 'off');
- }
- if(!this.lazyInit){
- this.initList();
- }else{
- this.on('focus', this.initList, this, {single: true});
- }
- if(!this.editable){
- this.editable = true;
- this.setEditable(false);
- }
- this.setValue(disValue);
- },
- initList : function(){
- if(!this.list){
- var cls = 'x-combo-list';
- this.list = new <span class="hilite1">Ext</span>
- .Layer({
- shadow: this.shadow, cls: [cls, this.listClass].join(' '), constrain:false
- });
- var lw = this.listWidth || Math.max(this.wrap.getWidth(), this.minListWidth);
- this.list.setWidth(lw);
- this.list.swallowEvent('mousewheel');
- this.assetHeight = 0;
- if(this.title){
- this.header = this.list.createChild({cls:cls+'-hd', html: this.title});
- this.assetHeight += this.header.getHeight();
- }
- this.innerList = this.list.createChild({cls:cls+'-inner'});
- this.innerList.on('mouseover', this.onViewOver, this);
- this.innerList.on('mousemove', this.onViewMove, this);
- this.innerList.setWidth(lw - this.list.getFrameWidth('lr'))
- if(this.pageSize){
- this.footer = this.list.createChild({cls:cls+'-ft'});
- this.pageTb = new <span class="hilite1">Ext</span>
- .PagingToolbar({
- store:this.store,
- pageSize: this.pageSize,
- renderTo:this.footer
- });
- this.assetHeight += this.footer.getHeight();
- }
- if(!this.tpl){
- //alert(cls);
- //x-combo-list-item
- this.tpl = '<tpl for="."><div class="'+cls+'-item"><span class="unchecked" id="checkBox_{' + this.displayField + '}"+ width="20"> </span>{' + this.displayField + '}</div></tpl>';
- }
- this.view = new <span class="hilite1">Ext</span>
- .DataView({
- applyTo: this.innerList,
- tpl: this.tpl,
- singleSelect: true,
- selectedClass: this.selectedClass,
- itemSelector: this.itemSelector || '.' + cls + '-item'
- });
- this.view.on('click', this.onViewClick, this);
- this.bindStore(this.store, true);
- if(this.resizable){
- this.resizer = new <span class="hilite1">Ext</span>
- .Resizable(this.list, {
- pinned:true, handles:'se'
- });
- this.resizer.on('resize', function(r, w, h){
- this.maxHeight = h-this.handleHeight-this.list.getFrameWidth('tb')-this.assetHeight;
- this.listWidth = w;
- this.innerList.setWidth(w - this.list.getFrameWidth('lr'));
- this.restrictHeight();
- }, this);
- this[this.pageSize?'footer':'innerList'].setStyle('margin-bottom', this.handleHeight+'px');
- }
- }
- },
- bindStore : function(store, initial){
- if(this.store && !initial){
- this.store.un('beforeload', this.onBeforeLoad, this);
- this.store.un('load', this.onLoad, this);
- this.store.un('loadexception', this.collapse, this);
- if(!store){
- this.store = null;
- if(this.view){
- this.view.setStore(null);
- }
- }
- }
- if(store){
- this.store = <span class="hilite1">Ext</span>
- .StoreMgr.lookup(store);
- this.store.on('beforeload', this.onBeforeLoad, this);
- this.store.on('load', this.onLoad, this);
- this.store.on('loadexception', this.collapse, this);
- if(this.view){
- this.view.setStore(store);
- }
- }
- },
- // private
- initEvents : function(){
- <span class="hilite1">Ext</span>
- .form.ComboBox.superclass.initEvents.call(this);
- this.keyNav = new <span class="hilite1">Ext</span>
- .KeyNav(this.el, {
- "up" : function(e){
- this.inKeyMode = true;
- this.selectPrev();
- },
- "down" : function(e){
- if(!this.isExpanded()){
- this.onTriggerClick();
- }else{
- this.inKeyMode = true;
- this.selectNext();
- }
- },
- "enter" : function(e){
- this.onViewClick();
- //return true;
- },
- "esc" : function(e){
- this.collapse();
- },
- "tab" : function(e){
- this.onViewClick(false);
- return true;
- },
- scope : this,
- doRelay : function(foo, bar, hname){
- if(hname == 'down' || this.scope.isExpanded()){
- return <span class="hilite1">Ext</span>
- .KeyNav.prototype.doRelay.apply(this, arguments);
- }
- return true;
- },
- forceKeyDown : true
- });
- this.queryDelay = Math.max(this.queryDelay || 10,
- this.mode == 'local' ? 10 : 250);
- this.dqTask = new <span class="hilite1">Ext</span>
- .util.DelayedTask(this.initQuery, this);
- if(this.typeAhead){
- this.taTask = new <span class="hilite1">Ext</span>
- .util.DelayedTask(this.onTypeAhead, this);
- }
- if(this.editable !== false){
- this.el.on("keyup", this.onKeyUp, this);
- }
- if(this.forceSelection){
- this.on('blur', this.doForce, this);
- }
- },
- onDestroy : function(){
- if(this.view){
- this.view.el.removeAllListeners();
- this.view.el.remove();
- this.view.purgeListeners();
- }
- if(this.list){
- this.list.destroy();
- }
- this.bindStore(null);
- <span class="hilite1">Ext</span>
- .form.ComboBox.superclass.onDestroy.call(this);
- },
- // private
- fireKey : function(e){
- if(e.isNavKeyPress() && !this.list.isVisible()){
- this.fireEvent("specialkey", this, e);
- }
- },
- // private
- onResize: function(w, h){
- <span class="hilite1">Ext</span>
- .form.ComboBox.superclass.onResize.apply(this, arguments);
- if(this.list && this.listWidth === undefined){
- var lw = Math.max(w, this.minListWidth);
- this.list.setWidth(lw);
- this.innerList.setWidth(lw - this.list.getFrameWidth('lr'));
- }
- },
- // private
- onDisable: function(){
- <span class="hilite1">Ext</span>
- .form.ComboBox.superclass.onDisable.apply(this, arguments);
- if(this.hiddenField){
- this.hiddenField.disabled = this.disabled;
- }
- },
- setEditable : function(value){
- if(value == this.editable){
- return;
- }
- this.editable = value;
- if(!value){
- this.el.dom.setAttribute('readOnly', true);
- this.el.on('mousedown', this.onTriggerClick, this);
- this.el.addClass('x-combo-noedit');
- }else{
- this.el.dom.setAttribute('readOnly', false);
- this.el.un('mousedown', this.onTriggerClick, this);
- this.el.removeClass('x-combo-noedit');
- }
- },
- // private
- onBeforeLoad : function(){
- if(!this.hasFocus){
- return;
- }
- this.innerList.update(this.loadingText ?
- '<div class="loading-indicator">'+this.loadingText+'</div>' : '');
- this.restrictHeight();
- this.selectedIndex = -1;
- },
- // private
- onLoad : function(){
- if(!this.hasFocus){
- return;
- }
- if(this.store.getCount() > 0){
- this.expand();
- this.restrictHeight();
- if(this.lastQuery == this.allQuery){
- if(this.editable){
- this.el.dom.select();
- }
- if(!this.selectByValue(this.value, true)){
- this.select(0, true);
- }
- }else{
- this.selectNext();
- if(this.typeAhead && this.lastKey != <span class="hilite1">Ext</span>
- .EventObject.BACKSPACE && this.lastKey != <span class="hilite1">Ext</span>
- .EventObject.DELETE){
- this.taTask.delay(this.typeAheadDelay);
- }
- }
- }else{
- this.onEmptyResults();
- }
- },
- // private
- onTypeAhead : function(){
- if(this.store.getCount() > 0){
- var r = this.store.getAt(0);
- var newValue = r.data[this.displayField];
- var len = newValue.length;
- var selStart = this.getRawValue().length;
- if(selStart != len){
- this.setRawValue(newValue);
- this.selectText(selStart, newValue.length);
- }
- }
- },
- // private
- onSelect : function(record, index){
- if(this.fireEvent('beforeselect', this, record, index) !== false){
- var r = this.store.getAt(index);
- var newValue = r.data[this.displayField];
- var check=document.getElementById("checkBox_"+newValue);
- if(check.className=="checked"){
- check.className="unchecked"
- }else{
- check.className="checked"
- }
- var value="";
- var hiddenValue="";
- for(var i=0;i<this.store.data.length;i++){
- var r = this.store.getAt(i);
- newValue = r.data[this.displayField];
- check=document.getElementById("checkBox_"+newValue);
- if(check.className=="checked"){
- value+= r.data[this.displayField]+this.displaySeparator;
- hiddenValue+= r.data[this.valueField]+this.valueSeparator;
- }
- }
- if(value.length>1){
- value=value.substring(0,value.length-this.displaySeparator.length);
- }
- if(hiddenValue.length>1){
- hiddenValue=hiddenValue.substring(0,value.length-this.valueSeparator.length);
- }
- this.setValue(value);
- this.hiddenField.value=hiddenValue;
- this.fireEvent('select', this, record, index);
- }
- },
- getValue : function(){
- if(this.valueField){
- return typeof this.value != 'undefined' ? this.value : '';
- }else{
- return <span class="hilite1">Ext</span>
- .form.ComboBox.superclass.getValue.call(this);
- }
- },
- /**
- * Clears any text/value currently set in the field
- */
- clearValue : function(){
- if(this.hiddenField){
- this.hiddenField.value = '';
- }
- this.setRawValue('');
- this.lastSelectionText = '';
- this.applyEmptyText();
- },
- setValue : function(v){
- var text = v;
- if(this.valueField){
- var r = this.findRecord(this.valueField, v);
- if(r){
- text = r.data[this.displayField];
- }else if(this.valueNotFoundText !== undefined){
- text = this.valueNotFoundText;
- }
- }
- this.lastSelectionText = text;
- <span class="hilite1">Ext</span>
- .form.ComboBox.superclass.setValue.call(this, text);
- this.value = v;
- },
- // private
- findRecord : function(prop, value){
- var record;
- if(this.store.getCount() > 0){
- this.store.each(function(r){
- if(r.data[prop] == value){
- record = r;
- return false;
- }
- });
- }
- return record;
- },
- // private
- onViewMove : function(e, t){
- this.inKeyMode = false;
- },
- // private
- onViewOver : function(e, t){
- if(this.inKeyMode){ // prevent key nav and mouse over conflicts
- return;
- }
- var item = this.view.findItemFromChild(t);
- if(item){
- var index = this.view.indexOf(item);
- this.select(index, false);
- }
- },
- // private
- onViewClick : function(doFocus){
- var index = this.view.getSelectedIndexes()[0];
- var r = this.store.getAt(index);
- if(r){
- this.onSelect(r, index);
- }
- if(doFocus !== false){
- this.el.focus();
- }
- },
- // private
- restrictHeight : function(){
- this.innerList.dom.style.height = '';
- var inner = this.innerList.dom;
- var fw = this.list.getFrameWidth('tb');
- var h = Math.max(inner.clientHeight, inner.offsetHeight, inner.scrollHeight);
- this.innerList.setHeight(h < this.maxHeight ? 'auto' : this.maxHeight);
- this.list.beginUpdate();
- this.list.setHeight(this.innerList.getHeight()+fw+(this.resizable?this.handleHeight:0)+this.assetHeight);
- this.list.alignTo(this.el, this.listAlign);
- this.list.endUpdate();
- },
- // private
- onEmptyResults : function(){
- this.collapse();
- },
- /**
- * Returns true if the dropdown list is expanded, else false.
- */
- isExpanded : function(){
- return this.list && this.list.isVisible();
- },
- selectByValue : function(v, scrollIntoView){
- if(v !== undefined && v !== null){
- var r = this.findRecord(this.valueField || this.displayField, v);
- if(r){
- this.select(this.store.indexOf(r), scrollIntoView);
- return true;
- }
- }
- return false;
- },
- select : function(index, scrollIntoView){
- this.selectedIndex = index;
- this.view.select(index);
- if(scrollIntoView !== false){
- var el = this.view.getNode(index);
- if(el){
- this.innerList.scrollChildIntoView(el, false);
- }
- }
- },
- // private
- selectNext : function(){
- var ct = this.store.getCount();
- if(ct > 0){
- if(this.selectedIndex == -1){
- this.select(0);
- }else if(this.selectedIndex < ct-1){
- this.select(this.selectedIndex+1);
- }
- }
- },
- // private
- selectPrev : function(){
- var ct = this.store.getCount();
- if(ct > 0){
- if(this.selectedIndex == -1){
- this.select(0);
- }else if(this.selectedIndex != 0){
- this.select(this.selectedIndex-1);
- }
- }
- },
- // private
- onKeyUp : function(e){
- if(this.editable !== false && !e.isSpecialKey()){
- this.lastKey = e.getKey();
- this.dqTask.delay(this.queryDelay);
- }
- },
- // private
- validateBlur : function(){
- return !this.list || !this.list.isVisible();
- },
- // private
- initQuery : function(){
- this.doQuery(this.getRawValue());
- },
- // private
- doForce : function(){
- if(this.el.dom.value.length > 0){
- this.el.dom.value =
- this.lastSelectionText === undefined ? '' : this.lastSelectionText;
- this.applyEmptyText();
- }
- },
- doQuery : function(q, forceAll){
- if(q === undefined || q === null){
- q = '';
- }
- var qe = {
- query: q,
- forceAll: forceAll,
- combo: this,
- cancel:false
- };
- if(this.fireEvent('beforequery', qe)===false || qe.cancel){
- return false;
- }
- q = qe.query;
- forceAll = qe.forceAll;
- if(forceAll === true || (q.length >= this.minChars)){
- if(this.lastQuery !== q){
- this.lastQuery = q;
- if(this.mode == 'local'){
- this.selectedIndex = -1;
- if(forceAll){
- this.store.clearFilter();
- }else{
- this.store.filter(this.displayField, q);
- }
- this.onLoad();
- }else{
- this.store.baseParams[this.queryParam] = q;
- this.store.load({
- params: this.getParams(q)
- });
- this.expand();
- }
- }else{
- this.selectedIndex = -1;
- this.onLoad();
- }
- }
- },
- // private
- getParams : function(q){
- var p = {};
- //p[this.queryParam] = q;
- if(this.pageSize){
- p.start = 0;
- p.limit = this.pageSize;
- }
- return p;
- },
- /**
- * Hides the dropdown list if it is currently expanded. Fires the 'collapse' event on completion.
- */
- collapse : function(){
- if(!this.isExpanded()){
- return;
- }
- this.list.hide();
- <span class="hilite1">Ext</span>
- .getDoc().un('mousewheel', this.collapseIf, this);
- <span class="hilite1">Ext</span>
- .getDoc().un('mousedown', this.collapseIf, this);
- this.fireEvent('collapse', this);
- },
- // private
- collapseIf : function(e){
- if(!e.within(this.wrap) && !e.within(this.list)){
- this.collapse();
- }
- },
- /**
- * Expands the dropdown list if it is currently hidden. Fires the 'expand' event on completion.
- */
- expand : function(){
- if(this.isExpanded() || !this.hasFocus){
- return;
- }
- this.list.alignTo(this.wrap, this.listAlign);
- var hvalueArray=this.hiddenField.value.split(this.valueSeparator);
- for(var i=0;i<this.store.data.length;i++){
- var r = this.store.getAt(i);
- var newValue = r.data[this.displayField];
- var v=r.data[this.valueField];
- for(var j=0;j<hvalueArray.length;j++){
- if(hvalueArray[j]==v){
- document.getElementById("checkBox_"+newValue).className="checked";
- }
- }
- }
- this.list.show();
- <span class="hilite1">Ext</span>
- .getDoc().on('mousewheel', this.collapseIf, this);
- <span class="hilite1">Ext</span>
- .getDoc().on('mousedown', this.collapseIf, this);
- this.fireEvent('expand', this);
- },
- // private
- // Implements the default empty TriggerField.onTriggerClick function
- onTriggerClick : function(){
- if(this.disabled){
- return;
- }
- if(this.isExpanded()){
- this.collapse();
- this.el.focus();
- }else {
- this.onFocus({});
- if(this.triggerAction == 'all') {
- this.doQuery(this.allQuery, true);
- } else {
- this.doQuery(this.getRawValue());
- }
- this.el.focus();
- }
- }
- });
- <span class="hilite1">Ext</span>
- .reg('multicombo', <span class="hilite1">Ext</span>
- .form.MultiComboBox);
ext-all.css文件最后添加两行支持样式:
1.checked{background-image:url(../images/default/menu/checked.gif)}
2.unchecked{background-image:url(../images/default/menu/unchecked.gif)}
发表评论
-
EXT弹出窗口(转载)
2015-02-26 16:56 3178Ext.MessageBox.alert() Ext.Me ... -
Extjs教程_第六章_Editor_Grids(可编辑表格) (转载)
2015-02-15 16:04 6237在之前的一章中我 ... -
extJs 2.1学习笔记(Ext.Updater篇二) (转载)
2015-02-15 15:13 1307原文地址:http://blog.csdn.net/huo ... -
三大主流浏览器Web开发工具(转载)
2015-02-03 14:55 2784一个快速加载网页在很大程度上节约用户的浏览页面时间成本,作 ... -
ext+struts2排除List泛型中不想封装的属性(转载)
2015-02-02 18:10 1418struts2封装json,排除不想封装的字段配置,减少网 ... -
Ext Store Filter的实现和问题(转)
2014-01-26 14:33 6617Store包含两个数据缓存 - snapshot和data ... -
ExtJs之Ext.data.Store详解(转载)
2014-01-26 10:31 61896Ext.data.Store是EXT中用来进行数据交换和数据 ... -
Ext Grid表格导出excel
2013-08-22 16:10 4590两种方法,这是一种 ... -
ext中屏蔽backsapce删除时退出的代码
2012-07-31 11:37 1593<script type="text/java ... -
Ext 布局的一些配置属性
2012-07-10 16:48 1544布局配置中,layout和itmes是常用的,通过layout ... -
Ext CardLayout,AnchorLayout,AbsoulteLayout,FormLayout,ColumnLayout,TableLayout
2012-07-10 16:29 18971,CardLayout可以看做一叠卡片,是实现操作向导的典型 ... -
Ext AccordionLayout 布局
2012-07-10 15:58 1509Accordion布局类似于QQ中的伸缩菜单,通过点击可以折叠 ... -
Ext BorderLayout 布局
2012-07-10 11:59 2042BorderLayout布局比fit布局 ... -
Ext FitLayout 布局
2012-07-10 11:37 1242fit布局将使得组件自适应,子面板自动填充整个组件所占范围,不 ... -
Extjs的布局--学习(有例子)(转载)
2012-07-03 17:39 6329所谓布局就是指容器组件中子元素的分布、排列组合方式。Ext的所 ... -
Ext.query()和Ext.get()的区别,Ext.query()类似于jquery的DOM选择器
2012-07-03 17:02 2677Ext.get() 和 Ext.query() 取 ... -
Ext组件ComboBox 中getValue()和getRawValue()的区别
2012-06-29 10:04 6782当把Ext.form.ComboBox 的editable 设 ... -
ExtJs页面布局详解
2012-06-20 16:29 6448EXT标准布局类 面板相当于一张干净的白纸,如果直接在上 ... -
Extjs xtype 一览表
2012-02-09 16:10 24005ExtJs xtype一览 基本组件: ... -
Ext中的get、getDom、getCmp、getBody、getDoc的区别 (转)
2012-02-02 16:28 1771Ext 中包含了几个以 get 开头的方法,这些方法 ...
相关推荐
通过深入学习EXTJS的"ext下拉多选组件multicombo",开发者可以掌握如何在自己的应用中实现多选下拉功能,提升用户体验。同时,对源码的研究有助于增强EXTJS框架的理解,从而更好地进行组件的扩展和定制,满足特定...
最后,`multiCombox` 文件名可能指的是一个包含实现多选下拉框功能的代码或示例的文件。如果你有这个文件,可以参考其中的内容,结合上述讲解来理解和学习多选ComboBox的实现。在实践中,不断探索和调试,你将更熟练...
级联H桥SVG无功补偿系统在不平衡电网中的三层控制策略:电压电流双闭环PI控制、相间与相内电压均衡管理,级联H桥SVG无功补偿系统在不平衡电网中的三层控制策略:电压电流双闭环PI控制、相间与相内电压均衡管理,不平衡电网下的svg无功补偿,级联H桥svg无功补偿statcom,采用三层控制策略。 (1)第一层采用电压电流双闭环pi控制,电压电流正负序分离,电压外环通过产生基波正序有功电流三相所有H桥模块直流侧平均电压恒定,电流内环采用前馈解耦控制; (2)第二层相间电压均衡控制,注入零序电压,控制通过注入零序电压维持相间电压平衡; (3)第三层相内电压均衡控制,使其所有子模块吸收的有功功率与其损耗补,从而保证所有H桥子模块直流侧电压值等于给定值。 有参考资料。 639,核心关键词: 1. 不平衡电网下的SVG无功补偿 2. 级联H桥SVG无功补偿STATCOM 3. 三层控制策略 4. 电压电流双闭环PI控制 5. 电压电流正负序分离 6. 直流侧平均电压恒定 7. 前馈解耦控制 8. 相间电压均衡控制 9. 零序电压注入 10. 相内电压均衡控制 以上十个关键词用分号分隔的格式为:不
GTX 1080 PCB图纸,内含图纸查看软件
内容概要:本文档详细介绍了利用 DeepSeek 进行文本润色和问答交互时提高效果的方法和技巧,涵盖了从明确需求、提供适当上下文到尝试开放式问题以及多轮对话的十个要点。每一部分内容都提供了具体的示范案例,如指定回答格式、分步骤提问等具体实例,旨在指导用户更好地理解和运用 DeepSeek 提升工作效率和交流质量。同时文中还强调了根据不同应用场景调整提示词语气和风格的重要性和方法。 适用人群:适用于希望通过优化提问技巧以获得高质量反馈的企业员工、科研人员以及一般公众。 使用场景及目标:本文针对所有期望提高 DeepSeek 使用效率的人群,帮助他们在日常工作中快速获取精准的答案或信息,特别是在撰写报告、研究材料准备和技术咨询等方面。此外还鼓励用户通过不断尝试不同形式的问题表述来进行有效沟通。 其他说明:该文档不仅关注实际操作指引,同样重视用户思维模式转变——由简单索取答案向引导 AI 辅助创造性解决问题的方向发展。
基于FPGA与W5500实现的TCP网络通信测试平台开发——Zynq扩展口Verilog编程实践,基于FPGA与W5500芯片的TCP网络通信测试及多路Socket实现基于zynq开发平台和Vivado 2019软件的扩展开发,基于FPGA和W5500的TCP网络通信 测试平台 zynq扩展口开发 软件平台 vivado2019.2,纯Verilog可移植 测试环境 压力测试 cmd命令下ping电脑ip,同时采用上位机进行10ms发包回环测试,不丢包(内部数据回环,需要时间处理) 目前实现单socket功能,多路可支持 ,基于FPGA; W5500; TCP网络通信; Zynq扩展口开发; 纯Verilog可移植; 测试平台; 压力测试; 10ms发包回环测试; 单socket功能; 多路支持。,基于FPGA与W5500的Zynq扩展口TCP通信测试:可移植Verilog实现的高效网络通信
Labview液压比例阀伺服阀试验台多功能程序:PLC通讯、液压动画模拟、手动控制与调试、传感器标定、报警及记录、自动实验、数据处理与查询存储,报表生成与打印一体化解决方案。,Labview液压比例阀伺服阀试验台多功能程序:PLC通讯、液压动画模拟、手动控制与调试、传感器标定、报警管理及实验自动化,labview液压比例阀伺服阀试验台程序:功能包括,同PLC通讯程序,液压动画,手动控制及调试,传感器标定,报警设置及报警记录,自动实验,数据处理曲线处理,数据库存储及查询,报表自动生成及打印,扫码枪扫码及信号录入等~ ,核心关键词:PLC通讯; 液压动画; 手动控制及调试; 传感器标定; 报警设置及记录; 自动实验; 数据处理及曲线处理; 数据库存储及查询; 报表生成及打印; 扫码枪扫码。,Labview驱动的智能液压阀测试系统:多功能控制与数据处理
华为、腾讯、万科员工职业发展体系建设与实践.pptx
1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。
电网不对称故障下VSG峰值电流限制的柔性控制策略:实现电流平衡与功率容量的优化利用,电网不对称故障下VSG峰值电流限制的柔性控制策略:兼顾平衡电流与功率控制切换的动态管理,电网不对称故障下VSG峰值电流限制的柔性不平衡控制(文章完全复现)。 提出一种在不平衡运行条件下具有峰值电流限制的可变不平衡电流控制方法,可灵活地满足不同操作需求,包括电流平衡、有功或无功恒定运行(即电流控制、有功控制或无功控制之间的相互切),注入电流保持在安全值内,以更好的利用VSG功率容量。 关键词:VSG、平衡电流控制、有功功率控制、无功功率控制。 ,VSG; 峰值电流限制; 柔性不平衡控制; 电流平衡控制; 有功功率控制; 无功功率控制。,VSG柔性控制:在电网不对称故障下的峰值电流限制与平衡管理
1、文件内容:libpinyin-tools-0.9.93-4.el7.rpm以及相关依赖 2、文件形式:tar.gz压缩包 3、安装指令: #Step1、解压 tar -zxvf /mnt/data/output/libpinyin-tools-0.9.93-4.el7.tar.gz #Step2、进入解压后的目录,执行安装 sudo rpm -ivh *.rpm 4、更多资源/技术支持:公众号禅静编程坊
数据集是一个以经典动漫《龙珠》为主题的多维度数据集,广泛应用于数据分析、机器学习和图像识别等领域。该数据集由多个来源整合而成,涵盖了角色信息、战斗力、剧情片段、台词以及角色图像等多个方面。数据集的核心内容包括: 角色信息:包含《龙珠》系列中的主要角色及其属性,如名称、种族、所属系列(如《龙珠》《龙珠Z》《龙珠超》等)、战斗力等级等。 图像数据:提供角色的图像资源,可用于图像分类和角色识别任务。这些图像来自动画剧集、漫画和相关衍生作品。 剧情与台词:部分数据集还包含角色在不同故事中的台词和剧情片段,可用于文本分析和自然语言处理任务。 战斗数据:记录角色在不同剧情中的战斗力变化和战斗历史,为研究角色成长和剧情发展提供支持。 数据集特点 多样性:数据集整合了角色、图像、文本等多种类型的数据,适用于多种研究场景。 深度:不仅包含角色的基本信息,还涵盖了角色的成长历程、技能描述和与其他角色的互动关系。 实用性:支持多种编程语言(如Python、R)的数据处理和分析,提供了详细的文档和示例代码。
基于protues仿真的多功公交站播报系统设计(仿真图、源代码) 该设计为基于protues仿真的多功公交站播报系统,实现温度显示、时间显示、和系统公交站播报功能; 具体功能如下: 1、系统使用51单片机为核心设计; 2、时钟芯片进行时间和日期显示; 3、温度传感器进行温度读取; 4、LCD12864液晶屏进行相关显示; 5、按键设置调节时间; 6、按键设置报站; 7、仿真图、源代码; 操作说明: 1、下行控制报站:首先按下(下行设置按键),(下行指示灯)亮,然后按下(手动播报)按键控制播报下一站; 2、上行控制报站:首先按上(上行设置按键),(上行指示灯)亮,然后按下(手动播报)按键控制播报下一站; 3、按下关闭播报按键,则关闭播报功能和清除显示
采用Java后台技术和MySQL数据库,在前台界面为提升用户体验,使用Jquery、Ajax、CSS等技术进行布局。 系统包括两类用户:学生、管理员。 学生用户 学生用户只要实现了前台信息的查看,打开首页,查看网站介绍、琴房信息、在线留言、轮播图信息公告等,通过点击首页的菜单跳转到对应的功能页面菜单,包括网站首页、琴房信息、注册登录、个人中心、后台登录。 学生用户通过账户账号登录,登录后具有所有的操作权限,如果没有登录,不能在线预约。学生用户退出系统将注销个人的登录信息。 管理员通过后台的登录页面,选择管理员权限后进行登录,管理员的权限包括轮播公告管理、老师学生信息管理和信息审核管理,管理员管理后点击退出,注销登录信息。 管理员用户具有在线交流的管理,琴房信息管理、琴房预约管理。 在线交流是对前台用户留言内容进行管理,删除留言信息,查看留言信息。
MATLAB可以用于开发人脸识别考勤系统。下面是一个简单的示例流程: 1. 数据采集:首先收集员工的人脸图像作为训练数据集。可以要求员工提供多张照片以获得更好的训练效果。 2. 图像预处理:使用MATLAB的图像处理工具对采集到的人脸图像进行预处理,例如灰度化、裁剪、缩放等操作。 3. 特征提取:利用MATLAB的人脸识别工具包,如Face Recognition Toolbox,对处理后的图像提取人脸特征,常用的方法包括主成分分析(PCA)和线性判别分析(LDA)等。 4. 训练模型:使用已提取的人脸特征数据集训练人脸识别模型,可以选择支持向量机(SVM)、卷积神经网络(CNN)等算法。 5. 考勤系统:在员工打卡时,将摄像头捕获的人脸图像输入到训练好的模型中进行识别,匹配员工信息并记录考勤数据。 6. 结果反馈:根据识别结果,可以自动生成考勤报表或者实时显示员工打卡情况。 以上只是一个简单的步骤,实际开发过程中需根据具体需求和系统规模进行定制和优化。MATLAB提供了丰富的图像处理和机器学习工具,是开发人脸识别考勤系统的一个很好选择。
hjbvbnvhjhjg
HCIP、软考相关学习PPT提供下载
绿豆BOX UI8版:反编译版六个全新UI+最新后台直播管理源码 最新绿豆BOX反编译版六个UI全新绿豆盒子UI8版本 最新后台支持直播管理 作为UI6的升级版,UI8不仅修复了前一版本中存在的一些BUG,还提供了6套不同的UI界面供用户选择,该版本有以下特色功能: 在线管理TVBOX解析 在线自定义TVBOX 首页布局批量添加会员信息 并支持导出批量生成卡密 并支持导出直播列表管理功能
vue3的一些语法以及知识点
西门子大型Fanuc机器人汽车焊装自动生产线程序经典解析:PLC博图编程与MES系统通讯实战指南,西门子PLC博图汽车焊装自动生产线FANUC机器人程序经典结构解析与MES系统通讯,西门子1500 大型程序fanuc 机器人汽车焊装自动生产线程序 MES 系统通讯 大型程序fanuc机器人汽车焊装自动生产线程序程序经典结构清晰,SCL算法堆栈,梯形图和 SCL混编使用博图 V14以上版本打开 包括: 1、 PLC 博图程序 2 触摸屏程序 ,西门子1500; 大型程序; fanuc机器人; 汽车焊装自动生产线; MES系统通讯; SCL算法; 梯形图; SCL混编; 博图V14以上版本。,西门子博图大型程序:汽车焊装自动生产线MES系统通讯与机器人控制