PDA

View Full Version : Combobox



gameboy87
5 Apr 2012, 9:01 PM
Scenario:
I have a combo in a FormPanel. And I get the list of values from a text file using a store A. Now, If I select a value in the combo, and click 'Apply' button, the value gets into DB. I use another data store B to query the DB of the value set previously and set in the combo.

Now, a weird thing happens ! After the page loads, and by clicking the combo(1st), the values from the store A pops up as a list .But, the set value is not shown as highlighted and the area of the item is not autoscrolled. Instead the list just pops up. After the 2nd click, the set value is shown as highlighted and the area where the item resides gets scrolled automatically. How in single click the set value area can be shown in combo as highlighted one ?

I set autoSelect:true, but it is of no use.

Please help !

mitchellsimoens
6 Apr 2012, 7:31 AM
What Ext JS 4 version are you seeing this? Basically the value is not selected upon the first expand of the combobox?

gameboy87
12 Apr 2012, 12:31 AM
I use 4.0.7 So, how by default I can make the value select upon the first expansion of the combo ?


What Ext JS 4 version are you seeing this? Basically the value is not selected upon the first expand of the combobox?

gameboy87
16 Apr 2012, 9:44 PM
Any info on this ?

mitchellsimoens
17 Apr 2012, 4:06 AM
This selects the value for me in 4.0.7 and 4.1.0 RC3


new Ext.panel.Panel({
renderTo : document.body,
width : 400,
height : 400,
items : [
{
xtype : 'combobox',
fieldLabel : 'Test',
value : 'AK',
queryMode : 'local',
displayField : 'name',
valueField : 'abbr',
store : new Ext.data.Store({
fields : ['abbr', 'name'],
data : [
{ abbr : 'AL', name : 'Alabama' },
{ abbr : 'AK', name : 'Alaska' },
{ abbr : 'AZ', name : 'Arizona' }
]
})
}
]
});

gameboy87
18 Apr 2012, 10:22 PM
My Question is described in detail above. Please answer specifically. Thanks.


This selects the value for me in 4.0.7 and 4.1.0 RC3


new Ext.panel.Panel({
renderTo : document.body,
width : 400,
height : 400,
items : [
{
xtype : 'combobox',
fieldLabel : 'Test',
value : 'AK',
queryMode : 'local',
displayField : 'name',
valueField : 'abbr',
store : new Ext.data.Store({
fields : ['abbr', 'name'],
data : [
{ abbr : 'AL', name : 'Alabama' },
{ abbr : 'AK', name : 'Alaska' },
{ abbr : 'AZ', name : 'Arizona' }
]
})
}
]
});

mitchellsimoens
19 Apr 2012, 4:02 AM
The issue you describe is the value in the list is not selected correct? With my code in 4.0.7 and 4.1.0 RC3, the value is selected in the list.

gameboy87
24 Apr 2012, 5:21 AM
I have more than 15 values in the list. When I query the DB and set the value in a store to load(DB config on page load), the 16th value is not shown as highlighted nor as selected in the first click. On Second click, the 16th value is shown as highlighted one. I do not need by which version it works or not. I need the logic of highlighting the previous set value on First Click. Thanks.

1st click:

34445

2nd Click:
34446


The issue you describe is the value in the list is not selected correct? With my code in 4.0.7 and 4.1.0 RC3, the value is selected in the list.

gameboy87
26 Apr 2012, 11:03 PM
Any Info on this ?


I have more than 15 values in the list. When I query the DB and set the value in a store to load(DB config on page load), the 16th value is not shown as highlighted nor as selected in the first click. On Second click, the 16th value is shown as highlighted one. I do not need by which version it works or not. I need the logic of highlighting the previous set value on First Click. Thanks.

1st click:

34445

2nd Click:
34446

gameboy87
29 Apr 2012, 10:48 PM
Please do help me !


I have more than 15 values in the list. When I query the DB and set the value in a store to load(DB config on page load), the 16th value is not shown as highlighted nor as selected in the first click. On Second click, the 16th value is shown as highlighted one. I do not need by which version it works or not. I need the logic of highlighting the previous set value on First Click. Thanks.

1st click:

34445

2nd Click:
34446

gameboy87
2 May 2012, 11:04 PM
No more continuation for this Thread ?