I have a simple Employee list with fields ID and Name.
The index page allows the user to view all of the Employees information. They can then click on edit url link besides each record to change the record on the same page. All changes work off 1 action page. This works fine. I also have a sort feature for the index page that can sort the records by ID or Name for the display part of the index page. this works fine however i can not seem to get the sort to work when im in edit mode. Here is some of the code i have. Any help is appriciated and i thank you in advance.
URL.ID -- is what passes to the Editmode function
ID=#urlEncodedFormat(Trim(ID))#
It is the same code used to pass the id into edit mode and works for that function
Url.sortBy -- uses url to sort the display
Heres what i have that only works in Display for the sort
and how i thought it should work for both
<a href="index.cfm?<cfif IsDefined("url.ID"
><cfoutput>ID=#urlEncodedFormat(Trim(ID))#</cfoutput>
<cfelse>?sortBy=ID</cfif><cfif URL.sortBy EQ "ID"><cfif #sort# eq 'ASC'>&sortByType=DESC<cfelse>&sortByType=ASC</cfif>
</cfif>">ID</a></font></div></td>
The url link should look something like in the browser like
(8 is example of #ID# which can be selected)
index.cfm?ID=8/sortby=ID&sortbyType=DESC
The index page allows the user to view all of the Employees information. They can then click on edit url link besides each record to change the record on the same page. All changes work off 1 action page. This works fine. I also have a sort feature for the index page that can sort the records by ID or Name for the display part of the index page. this works fine however i can not seem to get the sort to work when im in edit mode. Here is some of the code i have. Any help is appriciated and i thank you in advance.
URL.ID -- is what passes to the Editmode function
ID=#urlEncodedFormat(Trim(ID))#
It is the same code used to pass the id into edit mode and works for that function
Url.sortBy -- uses url to sort the display
Heres what i have that only works in Display for the sort
and how i thought it should work for both
<a href="index.cfm?<cfif IsDefined("url.ID"
<cfelse>?sortBy=ID</cfif><cfif URL.sortBy EQ "ID"><cfif #sort# eq 'ASC'>&sortByType=DESC<cfelse>&sortByType=ASC</cfif>
</cfif>">ID</a></font></div></td>
The url link should look something like in the browser like
(8 is example of #ID# which can be selected)
index.cfm?ID=8/sortby=ID&sortbyType=DESC