RE: Sort records searched
I'd take a look at this: http://www.activewidgets.com/ !//-- andy matthews web developer ICGLink, Inc. [EMAIL PROTECTED] 615.370.1530 x737 --//- -Original Message- From: Orlini, Robert [mailto:[EMAIL PROTECTED] Sent: Friday, September 23, 2005 7:44 AM To: CF-Talk Subject: Sort records searched How do I do a sort on records that already have been searched and are displayed? I have a button that's called ascend and when clicked I want it to sort the selected records displayed but it sorts and displays the entire record count. For example on the search on lname it finds 7 records. In the display screen for those 7 records I want to sort them and the cfif isdefind takes care of that but of course it doesn't know the #form.lname# of the initial search and sorts through and displays all records. I guess I use a variable of some sort? Sorry its been a while. Any help appreciated. Thanks. Robert O. Here is the code: cfquery name=Getpc datasource=pc_inventory SELECT * FROM inventory where 0 = 0 CFIF IsDefined(FORM.lname) and form.lname NEQ And lname LIKE '#FORM.lname#%' /CFIF CFIF IsDefined(form.ascend.x) Order by pcname desc CFELSE Order By ID DESC /cfif /cfquery -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.11.1/104 - Release Date: 9/16/2005 ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:219049 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Sort records searched
do you just need to make sure that form.lname is still available for the second select? if that is the case then maybe the answer would be to have the display logic and the select as part of the cfm page in someway. for example cfparam name=form.lname default= cfif structkeyexists(form,mainsubmit) or structkeyexists(form,ascendbutton) !--- in here do your select --- /cfif !--- display your form here with action=thispage so that it submits to itself and ascend button also submits form --- If it seems wrong to have query and display logic in the same page then put them in separate files and use cfinclude to tidy things up. hope that helps On 9/23/05, Orlini, Robert [EMAIL PROTECTED] wrote: How do I do a sort on records that already have been searched and are displayed? I have a button that's called ascend and when clicked I want it to sort the selected records displayed but it sorts and displays the entire record count. For example on the search on lname it finds 7 records. In the display screen for those 7 records I want to sort them and the cfif isdefind takes care of that but of course it doesn't know the #form.lname# of the initial search and sorts through and displays all records. I guess I use a variable of some sort? Sorry its been a while. Any help appreciated. Thanks. Robert O. Here is the code: cfquery name=Getpc datasource=pc_inventory SELECT * FROM inventory where 0 = 0 CFIF IsDefined(FORM.lname) and form.lname NEQ And lname LIKE '#FORM.lname#%' /CFIF CFIF IsDefined(form.ascend.x) Order by pcname desc CFELSE Order By ID DESC /cfif /cfquery -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.11.1/104 - Release Date: 9/16/2005 ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:219051 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54