
December 19th, 2000, 08:00 AM
|
|
Contributing User
|
|
Join Date: Dec 2002
Posts: 14,575
  
Time spent in forums: < 1 sec
Reputation Power: 22
|
|
|
<i><b>Originally posted by : </b></i><br />You can try this<br />1.Put your table displaying records inside a form<br />2.Submit your form on each click of col. header, for this you will have to give href to each colmn. heading.<br />3.Make sure that you have same form defined as action for form <br />4.Now when you are submitting form pass a parameter that will determine order by clause eg. if you want to sort on name pass sort=Name<br />5.Request this sort parameter in form & form a dynamic 'order by' condition on basis of requested parameter e.g.<br />if sort = "name"<br /> orderby="field_name"<br />end if<br />6.Now attach this condition at end of query retrieving records in your table<br /><br />Hope this works..<br />------------<br />Heather at 11/28/2000 1:03:15 PM<br /><br />Does anyone know to code to sort by a column in a table when the column is clicked on? I saw a page that did that. I've read their code and can't figure out how they did it.<br /><br />Thanks.<br />
|