I am unaware of free code for a datagrid like the link above but you should be able to find something you can modify to fit your needs. It is not the most sophisiticated thing in the world to accomplish.
I would recommend that you do it with server-side scripting though rather than Javascript since the server-side code is going to be required for all of your database work anyway.
If you know how to read the data from the database then displaying it in the grid is not difficult and there are plenty of examples in the various programming forums.
Setting up column headers is not difficult and as you display each header you can set it as a link that will call the same page but passing the name of the column to sort by.
If you work with small amounts of data for the grid then you could pull the data down and store it in an array and then use Javascript to alter the display without reloading the page but if you pull down a lot of data then it is going to need to reload the page. If it is a very large amount of data then you would probably setup a view on the database for faster retrieval.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.