VelvetMirror Posted March 23, 2011 Share Posted March 23, 2011 I would like to learn to do something like this: http://www.ribosomatic.com/ejemplos/ordenar_columnas/It's a table that can be sorted. It uses AJAX, PHP and MySQL for the database. The explanation it's here (it's in spanish): http://www.ribosomatic.com/articulos/196/o...con-php-y-ajax/But it's a bit overwhelming to me at the moment, so I would like to read and practice more examples / tutorials in order to understand how to do this. I've already readed all the material related to this in w3schools (PHP, MySQL, javascript, AJAX ...)So I hope someone can help me out and give me some useful links for reading material about this. Link to comment Share on other sites More sharing options...
jeffman Posted March 23, 2011 Share Posted March 23, 2011 That looks very inefficient. Since the system only works when JavaScript is enabled, it would make more sense to forget about the server and let JavaScript do the sorting.One way to do that is to read the table data into a 2-dimensional array. The first dimension indexes a row, and the second dimension is a 3-member array containing data from each column. Call the array's sort method, passing the method a callback function. The callback function does the work of sorting the rows depending on values in the selected column.It takes a while to figure out, and it is the same process you would go through on the server anyway. So you might as well do it locally. Link to comment Share on other sites More sharing options...
thescientist Posted March 23, 2011 Share Posted March 23, 2011 i just used this in an app I was working on for work.http://tablesorter.com/docs/ Link to comment Share on other sites More sharing options...
jeffman Posted March 23, 2011 Share Posted March 23, 2011 That's just too freakin easy. Link to comment Share on other sites More sharing options...
thescientist Posted March 23, 2011 Share Posted March 23, 2011 work smarter, right? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.