Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
What's the easiest way to create sortable columns?
dlsoderberg
I have a page that I am going to be developing on which the column headers (Job title, description, and creation date) need to be sortable. Has anyone out there needed to have sortable column headers for content driven from a DCR? I have another option using ATG targeters to accomplish this, but their first preference is for everything to be done in TeamSite. I'm hoping this could be done with some Perl in the PT that will create 2 other versions of my output page when a user generates. The replicant area in the DCR will be kept with the Job Title field in alphabetical order. So when the user generates, some Perl code will create the 2 other versions sorted on Description and Creation Date in the background without the user needing to generate 3 separate pages.
Please respond back with any questions you may have or any suggestions.
Thanks
Find more posts tagged with
Comments
Dwayne
A combination of <iw_ostream> to create the files, and the
order="..."
attribute of <iw_iterate> should do the trick for you. The most complicated part will probably be coming up with an algorythm to determine the names of the secondary files, given the "primary" name
--
Current project: TS 5.5.2/6.1 W2K
Migrateduser
It's hard to give you an exact answer with the data you gave, but the short answer is yes. Basically you'll want to do it inside an <iw_perl> block. If I were you, I would create a list-of-hashes sort of data structure (see perldoc perldsc (and perldoc perlref if you aren't familiar with the way references work in perl)) representing the rows, and have a custom sort function (see perldoc -f sort) that would sort them the way I wanted. Use the iwpt_dcr_list function to get the replicant nodes as a list, and then sort that with your custom function. It's not quite a piece of cake, but it isn't all that difficult either.
Clear as mud?
Migrateduser
Oops! I missed the requirement to put it in three separate files. As Dwayne points out, iw_ostream is the appropriate vehicle to use for that.
Adam Stoller
iw_ostream or basic Perl I/O will work - neither one will set the TST EAs on the "additional" output files - so you'll have to take care of that too.
(I believe I have a FR on file for providing an option to iw_ostream for setting the EAs - but I can't remember the number off-hand)
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Migrateduser
Can you have the TPL generate XML, then have the application server transform with XSL, passing a parameter indicating which field to sort by?
LooseCannon
Keep it simple…
Generate 1 html page and sort on the client side with javascript
Google 'javascript sort columns' for code references.