-
25 Nov 2009 1:14 PM #111
newValue and oldValue
newValue and oldValue
Great sample. Thanks Andrie. I did not read all the posts but I did find an issue. You have:
this.fireEvent('change', this, this.oldValueArray, this.valueArray);
this.fireEvent('change', this, this.oldValue, this.getRawValue());
In itself, that is fine but it does not match the api for the combobox. It should be:
this.fireEvent('change', this, this.valueArray, this.oldValueArray);
this.fireEvent('change', this, this.getRawValue(), this.oldValue);
For my purpose, I also had to comment out:
this.valueArray = resultRaw; (line ~502)
That seemed to replace a set value when moving to other combo boxes. I am using 7 of your multi select combo boxes on one page. I do have an issue that I have work around but could not fix the code. I have listeners ('change') in each combo box. The newValue and oldValues work fine. There is a miss fire that messes it all up. If I make a selection from one combo box, all is fine. When I go to click on a different box, the onchange is fired on the first combo box twice. The first fires is ok. The second on the first combo box replaces the newValue with a string of results instead of an array of results. So the string is a comma separated from of the array. I could not figure out a fix for that so instead of using the newValue and oldValue in:
'change': function (combo, newValue, oldValue)
I am using the this.valueArray, this.oldValueArray as the work around. Did anyone encounter that issue? Thanks.
-
21 Jan 2010 1:33 AM #112
Multi select combo
Multi select combo
Hi all I have a problem with this widget. When i use a multiselect combobox and when i select a value in combo
first value is automatically show but not checked
for example when i choose M (also first element is M ) then combo's display is M;M
for example when i choose D (just only checked D ) then combo's display is M;D.
Thanx
-
13 Jun 2010 11:27 PM #113
problem in posting
problem in posting
hii andrei,
i have used ur mulitselect in my form , but on post m getting display field in comma seperated but i want the value field what can i do for this
please suggest ..
thanks
rahul
-
13 Jul 2010 9:57 PM #114
I encountered the following problem after upgrading to ExtJs 2.3. It's a pretty unique scenario but I thought I'd post it here just in case someone might make use of it.
I have a form containing some AndrieSelect components. Parts of the form are initially hidden. The form has a reset button. When the reset button is clicked, the widths of the AndrieSelect components are mangled by the onChange method attempting to hide the trigger (which is of course also hidden). Thus, when the form is made visible, the widths of each AndrieSelect are completely messed up (10 - 20px wide).
To fix this I wrote a very simple override which tests the visibility of the trigger before trying to hide it:
Code:onChange: function() { if (!this.clearTrigger) { return; } if (this.getValue() !== '') { this.triggers[0].show(); } else { //check to see if triggers[0] is visible before hiding, only hide it //if it's visible first if (this.triggers[0].isVisible()) { this.triggers[0].hide(); } } }
-
23 Jul 2010 4:25 AM #115
Here's is a patch that adds a config option called "multipleHiddenFields" which if set to true will split the hidden field into multiple hidden fields (one for each value) with the same name, to match the data sent using a regular HTML Select input.
Code:--- Ext.ux.Andrie.Select.js.orig Fri Jul 23 14:12:47 2010 +++ Ext.ux.Andrie.Select.js Fri Jul 23 14:18:54 2010 @@ -76,6 +76,10 @@ * @cfg {String} displaySeparator Separator to use for displaying the values (defaults to comma) */ displaySeparator:',', + /** + * @cfg {Boolean} multipleHiddenFields Split different values into multiple hidden fields to match the regular HTML Select input value sent (defaults to false) + */ + multipleHiddenFields:false, // private valueArray:[], @@ -107,6 +111,16 @@ this.setValue(this.value); } }, + + // private + onRender : function(ct, position){ + Ext.ux.Andrie.Select.superclass.onRender.call(this, ct, position); + + if(this.multipleHiddenFields){ + this.hiddenFields = []; + Ext.get(this.hiddenField).remove(); + } + }, hideTrigger1:true, @@ -562,7 +583,21 @@ this.lastSelectionText = text; this.valueArray = result; this.rawValueArray = resultRaw; - if(this.hiddenField){ + + if(this.multipleHiddenFields){ + var hiddenField; + + for (var i=0; i<this.hiddenFields.length; i++) { + Ext.get(this.hiddenFields[i]).remove(); + } + this.hiddenFields = []; + + for (var i=0; i<this.valueArray.length; i++) { + hiddenField = this.el.insertSibling({tag:'input', type:'hidden', name: this.hiddenName, value: this.valueArray[i]}, 'before', true); + this.hiddenFields.push(hiddenField); + } + } + else if(this.hiddenField){ this.hiddenField.value = v; } Ext.form.ComboBox.superclass.setValue.call(this, text);Last edited by semiaddict; 23 Jul 2010 at 4:28 AM. Reason: Added the attachment
---
Oussama Mubarak // Semiaddict
-
9 Nov 2010 11:38 PM #116
the Ext.ux.Andrie.Select is not visible when i use it in the following way
the Ext.ux.Andrie.Select is not visible when i use it in the following way
items : {
xtype : 'fieldset',
title : 'Target Filter',
items : [
new Ext.ux.Andrie.Select( {
id : 'qTBucket',
fieldLabel : 'Opty Size Bucket',
xtype : 'combo',
typeAhead : true,
triggerAction : 'all',
width : 140,
editable: true,
visible:true,
mode : 'local',
displayField: 'value',
multiSelect:true,
valueField : 'value',
lazyInit : true,
store : optySizeBucketStore,
listClass : 'x-combo-list-small'})
,
-
16 Nov 2010 2:01 AM #117
I've been battling with this plugin for about a day now and felt compelled to contribute. This plugin does not behave as I had expected. Even the demos seem to produce unpredictable results.
I know this plugin appears to be marked discontinued and this post is quite old but I feel the need to explain my findings.
Using the demo page "multiselect from markup" as an example:
- Select two values
- See the country codes in the value box
- Blur the field
- See the country codes converted into the value representation
- Select more values
- See the country codes appended to the value
- See the country codes duplicate into the value field
- Repeat
A plugin that I finally got to work the way I wanted (multiple select) is http://lovcombo.extjs.eu/.
-
19 Sep 2012 4:47 AM #118
MultiSelect works fine with this plugin
MultiSelect works fine with this plugin
I've used this plugin for multiselect combo in extjs 3.4.
Steps to follow:
1) include the plugin in your directory (js and css files)
2) you may need to comment out some lines as following in Select.js file of the plugin:
Ext.ux.Andrie.Select = function(config){
//following lines commented out intentionally to avoid some unexpected errors
/*if (config.transform && typeof config.multiSelect == 'undefined'){
var o = Ext.getDom(config.transform);
config.multiSelect = (Ext.isIE ? o.getAttributeNode('multiple').specified : o.hasAttribute('multiple'));
}
config.hideTrigger2 = config.hideTrigger2||config.hideTrigger;*/
Ext.ux.Andrie.Select.superclass.constructor.call(this, config);
}
3) use something like this:
this.cmbo = new Ext.ux.Andrie.Select({
id: 'OfficeCombo',
xtype: 'combo',
emptyText: 'Select All',
autoScroll: true,
store: enggOfficeStore,
displayField: 'FullName',
multiSelect: true,
valueField: 'ShortName',
mode: 'local',
listeners:{
select: function(record, index) {
alert(record.getValue());
//................
}
}
});
4) In the panel, you can use something like this
this.pnlEnggScreen = new Ext.Panel({
layout: 'column',
items: [this.cmbo]
})


Reply With Quote