-
13 Aug 2008 10:50 AM #1
gridpanel store.loadData doesnt refresh data
gridpanel store.loadData doesnt refresh data
I am trying to refresh the data on a grid using loadData but it doesnt refresh.
I've read the documentation and grid FAQ but I couldnt find anything that helped.Code:grid.getStore().loadData(Ext.grid.ResultData, false);
Thanks in advance.
-
13 Aug 2008 11:06 AM #2
Did you confirm that the data in the local store changed? Some other process changed the data store?
MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
13 Aug 2008 11:08 AM #3
Yes. i am doing a debug on the JSON string and its definately different.
-
13 Aug 2008 11:10 AM #4
another thing that i thought was weird was i alert the grid.getStore().getCount() before and after I load data and its correctly says 0 and 26 the first time. When i refresh the data, the first alert is 0 again!? shouldnt it be 26?
-
13 Aug 2008 11:15 AM #5
Some of your code would help here...
I recall looking into this before, I recall from checking the source that the grid should refresh regardless of the data source.MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
13 Aug 2008 11:18 AM #6
There isnt much code to post. I'm doing an ajax call to get the data again.
and the only thing I have is what i posted originally
Code:Ext.grid.ResultData = eval(jsonString);grid.getStore().loadData(Ext.grid.ResultData, false);
here's the config for the grid
Code:var xg = Ext.grid; // reader for attributes grid var reader = new Ext.data.ArrayReader({}, [ {name: 'name'}, {name: 'value'} ]); var attribData = []; var gridAttrib = new xg.GridPanel({ id:'docAttrib', title: 'Document Attributes', store: new Ext.data.Store({ reader: reader, data: attribData }), cm: new xg.ColumnModel([ //new xg.RowNumberer(), {header: "Name", width: 150, sortable: true, menuDisabled:true, dataIndex: 'name'}, {header: "Value", width: 450, sortable: true, menuDisabled:true, dataIndex: 'value'} ]), width:638, height:400, frame:true, hideBorders:true, bodyBorder:false, disableSelection:true, trackMouseOver: false }); if (docReviewWin==null) { docReviewWin= new Ext.Window({ id:'docReviewWin', el:'docReviewDiv', title:'Document for Review', width:660, height:560, closable:true, minimizable:false, maximizable:false, draggable:true, plain: true, floating:true, shadow:true, hideBorders:false, bodyBorder:true, resizable:false, ismodal:true, border:true, autoScroll:true, manager: windows, closeAction: 'hide', items: [notes, gridAttrib] }); } docReviewWin.show();


Reply With Quote