PDA

View Full Version : Combox 'query' Parameter and DirectProvider



richolsn
5 Jul 2009, 5:40 PM
I would like to enable my combo box to pass the current input that's in the textbox, on to the server. I don't see a way to do this with DirectProvider. I have successfully gotten a .NET implementation to return values back to the client, but am unable to figure out how to tell the api to pass the query into my method.

Any help is appreciated.

Here is what I currently have:



Ext.onReady(function() {
var menuStore = new Ext.data.DirectStore({
autoLoad: false,
directFn: Sample.getNames,
paramsAsHash: false,
idProperty: 'personId',
fields: ["personId", "firstName", "lastName"]
});
menuStore.on("exception", function(sender, type, action, options, response, arg) {
debugger;
//alert("exception");
}, menuStore);


var menuCbx = new Ext.form.ComboBox({
id: 'mypersoncbx',
hiddenName: 'personId',
displayField: 'firstName',
valueField: 'personId',
store: menuStore,
queryDelay: 1,
//mode: 'remote',
minChars: 0,
forceSelection: true,
//emptyText: 'Men',
renderTo: cb,
typeAhead: true,
editable: true,
forceSelection: true,
enableKeyEvents: true,
listeners: {
keydown: function(textField, e) {
//when user presses '.', force requery
if (e.getCharCode() == 190) {
//delete this.combo.lastQuery;
debugger;
this.doQuery('sometext', true);
}
}
}
});

richolsn
5 Jul 2009, 6:10 PM
to answer my own question..

You need to add the following parameter to the store creation:
paramOrder: ["query"],


Also, a new string parameter added to your server method. Presto, works like magic.