PDA

View Full Version : Why datastore doesn't show records



myzxzh
28 Jul 2009, 6:33 PM
I create a store in one function. The codes are:


for (var i=0;i<indicatorlist.length;i++){
obj = {name :indicatorlist[i]}; //,
rowDefineArray[i+1]={name :indicatorlist[i]};

}

this.charStoreRecordType = Ext.data.Record.create(rowDefineArray);
this.charStore = new Ext.data.Store({
reader : new Ext.data.JsonReader({},this.charStoreRecordType),
proxy : new Ext.data.MemoryProxy()
});
var indicatrecord = new Object();
this.gridStore.queryBy(function(r,i){

var r_date = r.get('date');
indicatrecord['date']=r_date;
alert(r_date);

for(var i=0;i<indicatorlist.length;i++){
var r_value = r.get(indicatorlist[i]);
indicatrecord[indicatorlist[i]]= r_value;

}

var record = new this.charStoreRecordType(indicatrecord);
this.charStore.insert(0,record);

},this);


When I use the store in another function , can just show the last records. Where is the problem in my coding ?

mjlecomte
28 Jul 2009, 6:49 PM
Please review this page:
http://extjs.com/learn/Ext_Forum_Help#How_to_post_code_properly

myzxzh
29 Jul 2009, 6:24 PM
Please help me to deal with the problem.

mjlecomte
29 Jul 2009, 6:31 PM
I can't read the code because it is not indented properly.

I don't understand your question / problem. Can you make a simple working example that would help clarify what your problem is?