GXT Remote Paging With GWT RPC

This code example shows how to make GXT grid with remote paging to work with GWT RPC.That's means you can use POST to send the request. I'm not sure whether it can be done before.

To do that,we need just need to use RpcProxy and override the load method.

Anyway, I put the sample code below.
I take it from GXT demo code.

final ExampleServiceAsync service = (ExampleServiceAsync) Registry.get(Examples.SERVICE);
RpcProxy<PagingLoadResult<Post>> proxy = new RpcProxy<PagingLoadResult<Post>>() {

    @Override
    public void load(Object loadConfig, AsyncCallback<PagingLoadResult<Post>> callback) {
        service.getPosts((PagingLoadConfig) loadConfig, callback);
    }
};

// loader  
final PagingLoader<PagingLoadResult<ModelData>> loader = new BasePagingLoader<PagingLoadResult<ModelData>>(proxy);
loader.setRemoteSort(true);
ListStore<Post> store = new ListStore<Post>(loader);

1 comments:

Joseph Makara said...

can you provide full example ..

 
Copyright © peyotest