PDA

View Full Version : Newbie: How to show the JSON data in paging grid.



hawking
26 Apr 2007, 1:14 AM
Now the examples' paging grid 's data is come from the url: http://www.yui-ext.com/forum2/topics-remote.php

I save it and get one data from them . then i create a new php file named test.php

<?
echo '({"totalCount":"2166","topics":[{"topic_id":"4523","forum_id":"4","topic_title":"context menu on multiple rows?","topic_poster":"4567","topic_time":"1175281349","topic_views":"31","topic_replies":"0","topic_status":"0","topic_vote":"0","topic_type":"0","topic_first_post_id":"20301","topic_last_post_id":"20301","topic_moved_id":"0","username":"KRavEN","user_id":"4567","user2":"KRavEN","id2":"4567","post_username":"","post_username2":"","post_time":"1175281349","post_text":"Im trying to select multiple rows and then right click to bring up a context menu to perform an action on all those rows.\r\n\r\nI have the context menu ..."}]})';
?>

and i change the example paging grid .

proxy: new Ext.data.ScriptTagProxy({
url: 'http://localhost/ext-1.0/examples/grid/test.php'
}),

when i access this php file . it show these data.
({"totalCount":"2166","topics":[{"topic_id":"4523","forum_id":"4","topic_title":"context menu on multiple rows?","topic_poster":"4567","topic_time":"1175281349","topic_views":"31","topic_replies":"0","topic_status":"0","topic_vote":"0","topic_type":"0","topic_first_post_id":"20301","topic_last_post_id":"20301","topic_moved_id":"0","username":"KRavEN","user_id":"4567","user2":"KRavEN","id2":"4567","post_username":"","post_username2":"","post_time":"1175281349","post_text":"Im trying to select multiple rows and then right click to bring up a context menu to perform an action on all those rows.\r\n\r\nI have the context menu ..."}]})

but when i access http://localhost/ext-1.0/examples/grid/paging.html . The data still is blank .

Am i make a mistake ?

thanks .

Animal
26 Apr 2007, 1:57 AM
Are you going cross-domain?

hawking
26 Apr 2007, 7:18 PM
Thanks a lot .

The problem have solved.

Just use httpProxy instead of ScriptTagProxy. ;)

Ext is Perfect ! :laught: