Extjs combobox - doQuery callback?

Posted by Ben on Stack Overflow See other posts from Stack Overflow or by Ben
Published on 2010-06-07T14:48:36Z Indexed on 2010/06/07 14:52 UTC
Read the original article Hit count: 988

Filed under:
|

Hi there,

I'm using the following combobox:

            var cb = new Ext.form.ComboBox({
            store: someDs,              
            fieldLabel: 'test',
            valueField:'name',
            displayField:'name_id',
            typeAhead: true,
            minChars: 3,
            triggerAction: 'query'
        });

So when the user typed in 3 chars, a query to the server is made showing the proper results.

Now I try to make the user input programmatically usint the doQuery() function of the combobox. After calling the doQuery() method, I want to seledct an Item via setValue().

        cb.doQuery('myval');
        cb.setValue('myval');

The problem is that setValue() can't select the propper value, because at the time it is called, the request started through doQuery() hasn't finished. So I need something like a callback in which I could use setValue() - but doQuery() doesn't seem to have a callback function.

any ideas? thanks!

© Stack Overflow or respective owner

Related posts about combobox

Related posts about extjs