May 23, 2013, 7:44 AM
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
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!
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 JSfunction 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!