gwt - How to reload data rows in GXT grid? -
assuming data retrieves datastore using rpcproxy, populate grid using liststore upon opening page.
then, there's form add entity , after modification reflect new list in gxt grid new added row.
how can reload grid? tried .reconfigure() method in grid didn't work.
grid.getstore().getloader().load();
update:
first of must extract grid before proxy, , second thing change rpc callback:
public class pagingbeanmodelgridexample extends layoutcontainer { //put grid class outside method or declare final on begin of method grid grid = null; protected void onrender(element parent, int index) { super.onrender(parent, index); rpcproxy> proxy = new rpcproxy>() { @override public void load(object loadconfig, final asynccallback> callback) { //modification here - callback overriden not passed through!! service.getbeanposts((pagingloadconfig) loadconfig, new asynccallback>() { public void onfailure(throwable caught) { callback.onfailure(caught); } public void onsuccess(pagingloadresult result) { callback.onsuccess(result); //here reloading store grid.getstore().getloader().load(); } }); } }; // loader final basepagingloader> loader = new basepagingloader>(proxy, new beanmodelreader()); liststore store = new liststore(loader); list columns = new arraylist(); //... columnmodel cm = new columnmodel(columns); grid = new grid(store, cm); add(grid); } }
Comments
Post a Comment