-
12 Dec 2012 6:38 AM #1
send message from server
send message from server
Hello !
I have a grid.
and i load data from my server in the grid.Code:gridProducts = new Ext.grid.GridPanel({ store: jsonStoreProducts, autoHeight: true, stripeRows: true, width: 550, loadMask: true, columnLines: true, id: 'productsGrid', ...
In same situation i have no data andCode:jsonStoreProducts.load();
i will send a message to the user.
I there a simple way to send a message ?Code:Ext.messageBox.alert('no data');
Sorry for my bad english.
Your sincerly Stephan
-
13 Dec 2012 4:56 AM #2
In the store's load event, do store.getTotalCount().
This will give you the number of records loaded.
If it is 0, show the alert .
-
13 Dec 2012 5:59 AM #3
Message from the server
Message from the server
Hello!
Thanks for the answer. I want to publish a message,
that is created on the server. The show with the message to
Ext.messageBox.alert (myServerMessage) done.
Can I store.load () represent a message?
Sincerely yours
Stephan
-
14 Dec 2012 3:27 AM #4
You mean in 1 operation you want to load records and get a message from the server side?
That is not possible but you can do this.
1. Load data
2. In the load event, do a Ext.Ajax.request that will get the message from the server
3. On success event , show the alert with the message
-
20 Dec 2012 7:03 PM #5
I your server side code, you could always check if you're returning zero records, and if so - return an additional message in the response to be used in your pop up message.
This way, you only need one request.


Reply With Quote