welcome to my space
- photography diploma
- lens squeak
- how long did it take
- battery problem
- buying lights
- how much latitude do
- how to control soft
- in need of good advi
- technical lense ques
- help with buying a d
- where can i buy a ca
- exposure meter probl
- why so blue
- custom white balanci
-
Archives
-
Categories
-
Search
-
Meta
-
Credits
12 March, 2010 |
JsonReader won't read data
my ext.data.Store function:
ds = new Ext.data.Store({
proxy: new Ext.data.ScriptTagProxy({url:'LINK TO DB'}),
reader: new Ext.data.JsonReader(
{root: "data", id: "uniqid"},
[
{
name: 'uniqid',
type:'int'
},
{
name: 'checked', type:'boolean'
},
{
name: 'caller'
},
{
name: 'player'
},
{
name: 'reason'
},
{
name: 'date'
},
{
name: 'server'
}
]
)
}
);
my Json data file:
{data:[{uniqid:64536344,checked:false,caller:"SGulseth",player:"A player",reason:"A reason",date:"1197386965",server:"ip:port"}]}
Firebug doesn't show any warnings or error.
Someone who sees the error?
Thanks
Thouroughly.
Also, if you are not really using the id field for some reason, it is optional in your JsonReader, and you can leave out the root property as well and just return the data itself. I have had the best results doing something like:
var reader = new Ext.data.JsonReader({ },
[
{name: "id" },
{name: "field1"},
{name: "fied2"}
]
);
// data looks like [{"id":1,"field1":"val 1", "field2":"val2"}]
Hmm, tried that earlier, didnt get any more knowledge. btw. I followed Scott Walter's screencast guide, "Building A Grid using extjs"
Quote from the top of the docs...
The content passed back from a server resource requested by a ScriptTagProxy is executable JavaScript source code that is used as the source inside a