Monday, January 29, 2007

Programing yui-ext grid at server-side

The setup is two pages , one to display the grid and other to write the xml(or json)

that the grid will fetch.

Step-by-step on server page (i will talk only about xml).

1)Set the content-type to xml

2)open the connection to your database

3)Get from your database only the records needed (advanced) or

get all the records from the table and transform to xml only the records needed.

4)If you did the query that gets only the records needed you will need another query to get the total records(for paging).If not you can increment a variable inside your loop to count the records.

5)write the xml to the page.

And that's it.

powered by performancing firefox

No comments: