PDA

View Full Version : [CLOSED][3.1] Is this a bug with jsonstore's loadData?



zzw0598
27 Dec 2009, 7:31 PM
I have defined a Store named userStore like this


var userStore = new Ext.data.Store({
proxy : new Ext.data.MemoryProxy(),
reader : new Ext.data.JsonReader({
root : 'gatherTaskCompileList',
idProperty: "consNo"
}, [{
name : 'orgName'
},{
name : 'consNo'
}])
});


and then I use loadData method to load an Array


userStore.loadData(result,true);


with the parameter true, if I add a record which not exists, It runs ok.
but if I add a record which exists, It gives an error in ie8
网页错误详细信息
用户代理: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; Creative AutoUpdate v1.20.00)
时间戳: Mon, 28 Dec 2009 03:29:13 UTC

消息: 'data' 为空或不是对象
行: 11
字符: 130310
代码: 0
URI: http://localhost:8080/IEIG/ext3/ext-all.js

and error in firefox : o is undefined


It works well in Ext3.0.0.

thanks.

zzw0598
27 Dec 2009, 8:36 PM
I debuged the ext-all-debug.js , it seems the error is appeared after load, when the store's grid is rendered.

and on an other computer, it seems that the errormsg is not same.

Condor
27 Dec 2009, 9:29 PM
This is a known 'feature' (e.g. see this thread (http://www.extjs.com/forum/showthread.php?p=326434#post326434)).

You can't use loadData to update data in the store. You can only use it to add new records to the store.

zzw0598
28 Dec 2009, 12:45 AM
but It works well in Ext 3.0.0 ,why?

Condor
28 Dec 2009, 12:55 AM
but It works well in Ext 3.0.0 ,why?

I doubt it...

If you want me to check this then I'm going to need:
1. A complete testcase.
2. The error message when using ext-all-debug.js (and preferably in english).

zzw0598
28 Dec 2009, 1:04 AM
user your this thread url ,I have solved the problem,
thanks very much!