-
25 Oct 2010 7:10 AM #1
Cannot add new row to grid using ListStore
Cannot add new row to grid using ListStore
Hi there,
I'm trying to add a new model to grid using ListStore, but I cannot add new row into grid.
I use following code to create a grid.
after grid rendered, I use the following code to add new row into grid.Code:private Grid<BaseModelData>createGrid() { ListStore<BaseModelData> store = new ListStore<BaseModelData>(); return new EditorGrid<BaseModelData>(store, createCoolumnModel()); } private ColumnModel createReachabilityColumnModel() { List<ColumnConfig> configs = new ArrayList<ColumnConfig>(); configs.add(new ColumnConfig("priority", "", 30)); configs.add(new ColumnConfig("type", "Type", 100)); return new ColumnModel(configs); }
I notice that, this model was successfully added into store, but it does not show in grid at all.Code:BaseModelData data = new BaseModelData(); data.set("priority", 1); data.set("type", "Normal"); grid.getStore().insert(data, store.getCount());
Any advice?
Thanks
Regards,
StellitLast edited by stellit; 25 Oct 2010 at 9:59 AM. Reason: correct instance name
-
25 Oct 2010 7:11 AM #2
What is "reach"? You called your new instance "data".
-
25 Oct 2010 9:59 AM #3
-
25 Oct 2010 10:02 AM #4
And it is still not working? Can you plesae post your code in a small and standalone testcase that implements EntryPoint?
-
5 Nov 2010 1:20 AM #5
Ok, just figured out the problem. the code is correct, works also in a empty entrypoint.
but if I put the code in to a window, or any panel within that window.
than insert does not work at all.
-
5 Nov 2010 2:22 AM #6
I doubt that this is the case. Can you plesae post your code as a small, standalone testcase, including the window?
Similar Threads
-
[CLOSED] grid issue when add diferent class to listStore
By fother in forum Ext GWT: Bugs (1.x)Replies: 19Last Post: 22 Dec 2008, 7:16 AM -
add new row to grid doesnt fire add event
By fxmisticat in forum Ext 2.x: Help & DiscussionReplies: 5Last Post: 22 Nov 2008, 10:19 AM


Reply With Quote