PDA

View Full Version : Help!!!Display Grid from JSON error



kevinwu8
10 Aug 2007, 2:19 AM
Hello All..

I have a grid sample code have problem..
here is my js's partial code about new a data store..


var ds = Ext.data.Store({
proxy: new Ext.data.HttpProxy({url:'Code/report1.php'}),
reader: new Ext.data.JsonReader({
id: 'id',root: 'sample', totalProperty: 'totalCount'},[
{name:'id', mapping:'id'},
{name:'b_perform',mapping:'b_perform'},
{name:'r_perform',mapping:'r_perform'},
{name:'p_reachrate',mapping:'p_reachrate'}
]),
remoteSort: false
});And below's JSON is responsed from my report1.php
{"sample":[{"id":"1","b_perform":"0","r_perform":"2,777","p_reachrate":"0.0"},
{"id":"2","b_perform":"20","r_perform":"","p_reachrate":"0.0"},
{"id":"3","b_perform":"0","r_perform":"-3","p_reachrate":"0.0"}]}

When i run My Javascript .. then FireBug display this error message:

this.onMetaChange has no properties
Store(Object proxy=Object reader=Object remoteSort=false)ext-all.js (line 78)
(no name)()report1.js (line 17)
Observable()ext-all.js (line 16)
EventManager()ext-all.js (line 18)

Ext.data.Store=function(_1){this.data=new Ext.util.MixedCollection(false);this.d...

Please help me..What's this mean...How to solve this Problem???
Thanks
Kevin..

mystix
10 Aug 2007, 5:00 AM
[ moved from General to Help ]

please post help requests in Help, not General.

also, be sure to check out 6272 before posting in Help.
thanks.

tryanDLS
10 Aug 2007, 7:32 AM
Use ext-all-debug.js. Set BPs in Firefox and step thru the Store's code to see what's happening as it processing your response.

kevinwu8
10 Aug 2007, 10:34 AM
Hi.tryanDLS..

Thanks your reply..
Sorry for i study Extjs only three day..and still not familiar Extjs and Firebug..
But I try to include ext-all-debug.js
The Firebug's point out the error message:
this.onMetaChange has no properties
Store(Object proxy=Object reader=Object remoteSort=true)ext-all-debug.js (line 10290)
(no name)()report1.js (line 16)
fire()ext-all-debug.js (line 1363)
fireDocReady()ext-all-debug.js (line 1393)

chrome://firebug/content/blank.gif this.reader.onMetaChange = this.onMetaChange.createDelegate(this);

I try to search 'onMetaChange' & 'Extjs' by Google..But can't find any usable info to me...
Do you have any other suggest??

Thanks
Kevin..

shprota
7 Jan 2008, 6:23 PM
Hello All..

I have a grid sample code have problem..
here is my js's partial code about new a data store..


var ds = Ext.data.Store({



Here's the problem - you should have written the new keyword as in:


var ds = new Ext.data.Store({


Just spent an hour myself figuring what was wrong, found this question and thought to reply it just in case :)