PDA

View Full Version : store.load() and result grid is in a popup window: how to show wait msg?



zlevardy
21 Aug 2012, 9:19 AM
hi,

trying to implement a search from many databases, and sometimes these queries are slow. How can I force to have a wait message and to not allow result windows with grid until search completes?

current skeleton:

mystore.load({params...});
var win = new Window();

should I try to cover the whole lot into a ajax call?
It was not working, because after slow query, it is doing a "paging": localhost:8080/search.json?start=0&limit=25, and worst part is, it made automatically, and not including my required criteria=value parameter.
Any hints where this paging coming from? (not added paging at all)

thx,
Zol

zlevardy
23 Aug 2012, 11:04 AM
solution was by ajax call, and using loadData for the Store. Parsing by .data:

Ext.Ajax.request({
url: '/query.json',
params: sParams,
timeout: 300000, // (5mins)
method: 'POST',
waitMsg: 'Searching...',
scope: this,
success: function(response, opts) {
waitMessage.hide();
var obj = Ext.decode(response.responseText);
var myStore = Ext.StoreMgr.get('Search');
if (obj.success) {
myStore.loadData(obj.data);
}

scottmartin
24 Aug 2012, 9:53 AM
Thank you for providing the solution!

Scott.