View Full Version : [CLOSED] How to use data from database in "Combo with Templates and Ajax" example

Jan 14, 2013, 10:37 PM

I am needing to use the component having the "autofill" functionality in this example: http://examples2.ext.net/#/Form/ComboBox/Custom_Search/

How can I do this filling the store of combobox with an database and using the text that user are writting in my query?

I really need to use an handler like in example or can I use a method in server-side code of the page, that be called every time that user write one letter?

I appreciate your attention.

Jan 15, 2013, 12:58 AM

You can use DirectMethod to send data from DB to Client. Everything should be the same you just have to replace store's Proxy. Example: http://examples2.ext.net/#/GridPanel/ArrayGrid/PageProxy_with_DirectMethod/

Jan 15, 2013, 5:40 AM

Jan 15, 2013, 10:49 AM
Hello @avante,

There are two problems.

1. Referencing a DirectMethod within a user control.

By default, it is


So, this is wrong:


You can set up

public object BindData() { ... }
and use


See also:

We also investigate a possibility to get this working.


2. Using a static DirectMethod within a user control.

Unfortunately, it can be defined on the page level only. So, please remove "static".

Here are some more details.

Jan 15, 2013, 2:59 PM
We also investigate a possibility to get this working.


This should work after updating from SVN (trunk).

Jan 15, 2013, 10:47 PM

Jan 16, 2013, 12:04 AM
1) How can I filter the results that will appear in the combobox with the text that is written by the user, in the moment that he write?

2) What I need to do for the paging works? At this moment, all results of my research are appearing without respecting paging.

Please, take a look at this example http://examples2.ext.net/#/GridPanel/Paging_and_Sorting/DirectMethod/ . Requested query you can find in ExtraParams.

[DirectMethod(IDAlias = "UC")]
public object BindData(string action, Dictionary<string, object> extraParams)
StoreRequestParameters prms = new StoreRequestParameters(extraParams);
string query = (string)extraParams["query"];

return Data;

Jan 17, 2013, 8:51 AM

Jan 17, 2013, 9:39 AM
Setting these options for the Store appears to be helpful.

AutoLoad="true" IsPagingStore="true" PageSize="2"

Though it is a tricky scenario to load data on the Change event.

If you need to load data remotely on typing and organize paging, configuring the Store with a Proxy is the best solution.

Jan 17, 2013, 6:47 PM
Very good Daniil, it works now.

You can close this thread.

Thank you very much.