PDA

View Full Version : combo box problem



rahulmehta
26 May 2010, 11:19 PM
hii

i have used one combo in my form panel code of this items
is

items :
[{
xtype:'combo',
name : "customer",
store: customer,
fieldLabel : "Customer",
allowBlank: false,
typeAhead: false,
valueField: 'customer',
displayField: 'customer',
loadingText: 'Searching...',
mode: 'remote',
forceSelection: true,
selectOnFocus:true,
emptyText: 'Type the first characters of the name',
hideTrigger: true,
minChars: 1,
triggerAction: 'all',
anchor: '100%',
pageSize: 0,
editable: true
}


and my store code is this

var customer = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: 'customer.php'
}),
reader: new Ext.data.JsonReader({

},
[{name: 'customer'},
{name: 'customer'}
])
});

in the data of customer m having
file:///C:/DOCUME%7E1/acer/LOCALS%7E1/Temp/moz-screenshot.pngfile:///C:/DOCUME%7E1/acer/LOCALS%7E1/Temp/moz-screenshot-1.png
rahul, archana ,namita , jane

but when i type r in combo box it shows archana listing it doesnt show rahul in the text box for this what i need to do...

rubynile
27 May 2010, 12:10 AM
set editable as false.ia think it will solve your problem.because you giving force selection true and editable also true.

rahulmehta
27 May 2010, 12:27 AM
hi rubynile
thanks for reply
but by doing editable false not solving the problem,
the when i type the rahul it is automatic coverted into the first name of the combo what i can do to solve this proble m i need to go on by selecting the list of combo to select rahul but i want it on typing is it possible...
thanks

rahul

rahulmehta
27 May 2010, 12:28 AM
set editable as false.ia think it will solve your problem.because you giving force selection true and editable also true.
hi rubynile
thanks for reply
but by doing editable false not solving the problem,
the when i type the rahul it is automatic coverted into the first name of the combo what i can do to solve this proble m i need to go on by selecting the list of combo to select rahul but i want it on typing is it possible...
thanks

rahul

Condor
27 May 2010, 12:29 AM
No, that would stop you from typing text into the combobox.

Does your customer.php service support filtering? In that case configure your combobox with triggerAction:'query' and optionally with queryParam:'myparam' (the parameter name used for filtering - default is 'query').

If it doesn't then you should configure the combobox with mode:'local',triggerAction:'query' and load the store yourself (e.g. autoLoad:true).

rahulmehta
27 May 2010, 11:01 PM
No, that would stop you from typing text into the combobox.

Does your customer.php service support filtering? In that case configure your combobox with triggerAction:'query' and optionally with queryParam:'myparam' (the parameter name used for filtering - default is 'query').

If it doesn't then you should configure the combobox with mode:'local',triggerAction:'query' and load the store yourself (e.g. autoLoad:true).

can you provide me the example of trigger action query and param so that i can try to build according to that ...

Condor
28 May 2010, 12:13 AM
Let's say you configured your combobox with:

triggerAction: 'query',
queryParam: 'myparam'
Then typing 'abc' in the combobox would result in a POST request to customer.php with parameter myparam: 'abc'.
And your server should respond with all customers that start with 'abc'.

rahulmehta
28 May 2010, 2:26 AM
Let's say you configured your combobox with:

triggerAction: 'query',
queryParam: 'myparam'
Then typing 'abc' in the combobox would result in a POST request to customer.php with parameter myparam: 'abc'.
And your server should respond with all customers that start with 'abc'.

hiii condor

thanks

problem is solved

thanks

rahul