PDA

View Full Version : Newbie example for live grid



salvin18
1 Jul 2010, 11:27 PM
Hi,
I am totally new to GXT, I have understood the way store works,
However, the Live grid is way over my head, I cant seem to decipher the source code available online,

This could also be because the online example uses JSON.

Can anyone direct me towards using a live grid over an RPC call or a Memory proxy ?

Suppose I had a simple store:


class MyModel extends BaseModelData
{
private String name;
public MyModel(String name){
this.name = name;
set("name", name);
set("random", (Math.random())+"");
}
}
now i want to show this in a grid with 2 cols "name" and "random"

my server would probably have RPC to load value from data base:


public ArrayList<MyModel> loadNextBatchOfModels();or something like:



public int getMaxIndex();
public ArrayList<MyModel> loadModels(int startIndex, int endIndex);
or any other sample code...

I have also referred to this:http://www.sencha.com/forum/archive/index.php/t-86411.html
but it hasnt helped me yet...


Some one please help

sven
6 Jul 2010, 3:03 AM
Can anyone direct me towards using a live grid over an RPC call or a Memory proxy ?
It works the same as with JSON.

Instead of a HttpProxy or ScriptTagProxy you use the RpcProxy. And instead of the JsonReader you use the BeanModelReader.