Hi,
In my example grid first time i am displaying the null values when
panel is loaded.
But when i click the button 'getData', i need to get the data from the
server and populate again in the grid.
The code i am used for store is below:
GroupingStore store = new GroupingStore();
store.setReader(reader);
if(proxy!=null)
{
store.setDataProxy(proxy);
}
store.load();
GroupingStore storeTemp = new GroupingStore();
storeTemp.setReader(reader);
if(proxy!=null)
{
storeTemp.setDataProxy(proxy);
}
storeTemp.reload();
store.removeAll();
store.add(storeTemp.getRecords());
But i am getting the following error:
Cannot change the configuration Property 'store after the component
has been rendered.
Can u go throgh the complete function code and give me where i done
the mistake.
private GridPanel processTop5BuyOrders(GridPanel top5BuyGrid,Object[]
[] top5BuyOrders)
{
MemoryProxy proxy =null;
try
{
proxy = new MemoryProxy(top5BuyOrders);
}
catch(Exception e)
{
System.out.println("No data Found");
}
try
{
RecordDef recordDef = new RecordDef(
new FieldDef[]{
new StringFieldDef("stockId"),
new StringFieldDef("orderId"),
new FloatFieldDef("orderQty"),
new DateFieldDef("orderDateTime", "n/j
h:ia"),
new StringFieldDef("symbol")
}
);
ArrayReader reader = new ArrayReader(recordDef);
GroupingStore store = new GroupingStore();
store.setReader(reader);
if(proxy!=null)
{
store.setDataProxy(proxy);
}
// store.setSortInfo(new SortState("orderId",
SortDir.ASC));
// store.setGroupField("stockId");
store.load();
GroupingStore storeTemp = new GroupingStore();
storeTemp.setReader(reader);
if(proxy!=null)
{
storeTemp.setDataProxy(proxy);
}
// storeTemp.setSortInfo(new SortState("orderId",
SortDir.ASC));
// storeTemp.setGroupField("stockId");
storeTemp.reload();
store.removeAll();
store.add(storeTemp.getRecords());
if (store==null)
{
System.out.println(" store null");
top5BuyGrid.setStore(null);
return top5BuyGrid;
}
else
{
System.out.println(" store Not null");
}
ColumnConfig[] columns = new ColumnConfig[]{
//column ID is company which is later used in
setAutoExpandColumn
new ColumnConfig("Stock Id", "stockId", 100, true,
null, "stockId"),
new ColumnConfig("Order Id", "orderId", 70,true),
new ColumnConfig("Order Qty", "orderQty", 70),
new ColumnConfig("Order Date/Time", "orderDateTime",
220),
new ColumnConfig("Symbol", "symbol", 60)
};
ColumnModel columnModel = new ColumnModel(columns);
top5BuyGrid.setStore(store);
top5BuyGrid.setColumnModel(columnModel);
top5BuyGrid.setFrame(true);
top5BuyGrid.setStripeRows(true);
top5BuyGrid.setAutoExpandColumn("stockId");
top5BuyGrid.setTitle("Top 5 Buy Orders");
top5BuyGrid.setWidth(500);
top5BuyGrid.setHeight(350);
GroupingView gridView = new GroupingView();
gridView.setForceFit(true);
top5BuyGrid.setView(gridView);
top5BuyGrid.setFrame(true);
top5BuyGrid.setWidth(475);
top5BuyGrid.setHeight(300);
top5BuyGrid.setCollapsible(true);
top5BuyGrid.setAnimCollapse(false);
top5BuyGrid.setTitle("Top 5 Buy Orders");
top5BuyGrid.setIconCls("grid-icon");
if(proxy == null)
{
gridView.setEmptyText("No Data Found");
}
}
catch(Exception e)
{
e.printStackTrace();
}
return top5BuyGrid;
}
Thanks&Regards
Nitesh
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"GWT-Ext Developer Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/gwt-ext?hl=en
-~----------~----~----~----~------~----~------~--~---