Record Sort By Questions

5 posts by 2 authors in: Forums > CMS Builder
Last Post: September 17, 2012   (RSS)

By shawnpatoka - September 14, 2012

Hi, I am new to CmsBuilder.

Is there a way i can display a list of records, with a sort function on the top of the page? Like sort by zip code, sort alphabetically?

www.aavwi.com/seen_stream/list.php is where i would want that functionality.

Re: [shawnpatoka] Record Sort By Questions

By gregThomas - September 14, 2012

Hi,

There is a simple way to do this. You just need to pass over a orderBy variable in the URL with the column you want the data sorted by from the table. So you could have some links or a form at the top of your page that will pass over the order. Maybe something like this:

<!-- Assuming the zip code table column is called zipCode -->
Sort By: <a href="?orderBy=zipCode" >Zip Code</a>


If your using a getRecords function to get the data from the table, it should then order them by the column you passed in the URL automatically.

Thanks!
Greg Thomas







PHP Programmer - interactivetools.com

Re: [greg] Record Sort By Questions

By shawnpatoka - September 17, 2012

Thank you very much, that was exactly what I was looking for for the alphabetical sort. But is there any way I can have like a search field, and someone could type in their zipcode, and it would display only the results that are in X radius of that zipcode?

Re: [greg] Record Sort By Questions

By shawnpatoka - September 17, 2012

kk, sounds good. thanks for your help