First, i LOVE the JsonReader in the Data class! Awesome work, this is going to make things much easier to build. Nice work!
One suggestion:
In JsonReader.js, I notice that you can only pass a response:
Is there a way you can also pass Json text?
I ask because I use another AJAX provider that can return Json already, and I would like to get that returned Json string and just pass it directly to the JsonReader. In my scenario, I have already handled the response.responseText, and I already have the Json located in a string. I'd like to be able to call the JsonReader and just pass the Json string.
Possible for a future release?
Thanks!
-- W.G.
One suggestion:
In JsonReader.js, I notice that you can only pass a response:
Ext.extend(Ext.data.JsonReader, Ext.data.DataReader, {
read : function(response){
var json = response.responseText;
var o = eval("("+json+")");
if(!o) {
throw {message: "JsonReader.read: Json object not found"};
}
return this.readRecords(o);
},
I ask because I use another AJAX provider that can return Json already, and I would like to get that returned Json string and just pass it directly to the JsonReader. In my scenario, I have already handled the response.responseText, and I already have the Json located in a string. I'd like to be able to call the JsonReader and just pass the Json string.
Possible for a future release?
Thanks!
-- W.G.

|
#2
|
|
I assume that means you're not going thru the proxy classes, so you could just eval your json string into an object and pas that to readRecords() instead of calling read()
__________________
Tim Ryan - Ext JS Support Team Read BEFORE posting a question / posting a Bug Use Google to Search - API / Forum API Doc (3.x | 2.x | 1.x) / FAQ / Wiki / Tutorials / 1.x->2.0 Migration Guide ![]() |
|
#3
|
|
By George, that's true.. I could just eval my returned Json and pass to readRecords.
I love this forum, everyone is so enthused and offers such great insight. I've learned more about JavaScript in the last two months than I have in the last 4 years. Thank you! -- W.G. ![]() |
|
#4
|
|
Also, if it's going into a Store, you can eval the response and pass it to store.loadData(obj) and everythng in the store will get updated appropriately.
![]() |
讨论了ExtJS中JsonReader组件的使用方法,提出了直接传递JSON文本到readRecords方法以提高灵活性的建议,并得到了官方团队的支持。
6389

被折叠的 条评论
为什么被折叠?



