Hybrid View
-
25 Jul 2008 4:43 PM #1
How to display JsonReader data in Alert
How to display JsonReader data in Alert
Hi!
I am collecting data of a store through JSON Reader. Data received from server is in following format:
I have a button in Top Toolbar of a grid. When I click on this button, I want to display 'rights' value in alert message box. How it would be possible.Code:({"rights": "No Rights", "total":"2","results":[{"id":"10","c_code":"US","country":"United States"},{"id":"11","c_code":"UK","country":"United Kingdom"}]})
Can someone help me in this regards
Thanks in advance
-
25 Jul 2008 9:38 PM #2
http://localhost/extjs/docs/?class=Ext.data.Store
Read up on methods getAt()
Then read http://localhost/extjs/docs/?class=Ext.data.Record
get()
Eg:
PHP Code:var index = 0;
var record = randomStore.getAt(index);
alert(record.get('rights'));
-
26 Jul 2008 8:03 AM #3
Hi!
Thanks for guidance. But it is displaying 'Undefined'.
For demo, kindly visit following link :
http://vibersol.com/sitesdemo/rq/ind...admin/country/
Then click on 'Add Record' link.
-
28 Jul 2008 7:32 AM #4
Still waitng for some pin point solution....
Thanks in advance
-
28 Jul 2008 8:38 AM #5
I am not going to dig through your js files just to find the right section of code. If you want us to help you, you need to put a little bit of effort into providing the right information.
-
28 Jul 2008 9:02 AM #6
I get an error: [Break on this error] alert(record.get('rights'));
record is not defined.Noah
Senior Web Developer
NBA.com


Reply With Quote