GXT LiveGrid set default status string before and after loading the data through RPC call
I am using a liveGrid to load the data dymaically from the server. The code is working fine. Now, I need to do a small enhancement in that, and开发者_JAVA技巧 for that I need some advice.
I need to display, a generic string like "Loading...", before the data gets populated from the server. This can be done as following :-LiveGridView liveView = new LiveGridView();
liveView.setEmptyText("Loading...");Now, once the RPC call returns, I get my data, and I set the same in the live Grid and that works fine. But when I dont get any data from the RPC call, I need to change that "Loading..." string to a new string like "No data available on the server". So, how can I do that?
Thanks in advance.
Regards Ajay
I got the solution for this. After the data is loaded, we can add a Loader.Load listner on the loader, and check the Length of the result. If it equals zero, then change the LiveGridView's emptyText value.
Thanks Ajay
精彩评论