ComboBox store reload in beforeQuery problem

  1. #1

    ComboBox store reload in beforeQuery problem

    Actually this thread is related to my other post.

    I want to do a custom search of combobox by reload store in BeforeQuery event.

    In code behide
     cbo.Listeners.BeforeQuery.Handler = "beforeQuery(this);";
    In JS
    function beforeQuery(sender) {
        sender.lastQuery = null;
        var q = sender.getRawValue();
        sender.loaded = true;
        sender.store.reload({ params: { search: q} });
        sender.cancel = true;
    }
    The problem is every time I input, the store is reloaded twice.

    One is from beforeQuery that defined by me, and other I think is happen in doQuery.

    And the reload in doQuery cannot get correct result.

    I try to disable the doQuery by inserting sender.cancel = true; at last line, but it does not work.

    How can I disable doQuery? Thanks!
  2. #2
    Hi @Vinci,

    I don't think you need to reload a Store manually.

    If a ComboBox QueryMode is Remote (it is by default), when a ComboBox reloads its Store sending typed text as a parameter.
  3. #3
    Thank you. I get rid of the BeforeQuery.Handler
    and get the query string by HttpContext.Current.Request.QueryString["query"] in the according .ashx.

    Know it run fine.

Similar Threads

  1. [CLOSED] Combobox expands after the store reload
    By deejayns in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jan 24, 2012, 7:26 AM
  2. [CLOSED] Store Load-handler cant reload child store
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 04, 2011, 7:56 AM
  3. [CLOSED] Problem with focusRow() on Store.reload() with Firefox
    By csharpdev in forum 1.x Legacy Premium Help
    Replies: 21
    Last Post: Nov 18, 2010, 11:26 AM
  4. Store.reload() problem
    By Dgsoft.ru in forum 1.x Help
    Replies: 1
    Last Post: May 28, 2009, 2:14 PM
  5. Databind / Reload Store and GridPanel Problem
    By locoperoguapo in forum 1.x Help
    Replies: 5
    Last Post: Feb 10, 2009, 9:23 AM

Posting Permissions