The SAS Output Delivery System and reporting techniques

HTML Sortable Column

Reply
N/A
Posts: 0

HTML Sortable Column

Hi all,

We used to have a javascript attached to a html to make the column sortable in SAS 8. Unfortunately, the same code failed to work in SAS 9. Is there a new way to make certain columns in an HTML page sortable?

Thanks!
Martin
SAS Super FREQ
Posts: 8,743

Re: HTML Sortable Column

Hi:
If you use the HTML3 destination, you may find that your JavaScript works the way that it used to. HTML3 is the kind of markup that was created by default in SAS 8. So instead of opening and closing the ODS HTML destination, you might try opening and closing ODS HTML3 destination in SAS 9 and see if you get results that are the same as you got in SAS 8.

Otherwise, your best bet for help with this issue is to contact SAS Technical Support. These notes seem to be relevant, too:
http://support.sas.com/kb/24/068.html
http://support.sas.com/kb/24/067.html

cynthia
N/A
Posts: 0

Re: HTML Sortable Column

Thanks Cythnia. I will try the HTML3 way.

I would also like to try making "the script happy" as described in the note below. I wonder if you have the details about how I can do so?

This example will produce an error in SAS 9.1 without some modifications. The JavaScript expects every table header to be enclosed within tags; however, SAS 9.1 places the headers in tags. You can either modify the tagset to make the script happy

Thanks,
Martin
SAS Super FREQ
Posts: 8,743

Re: HTML Sortable Column

Hi, Martin:
By far, the easiest thing to do is to use the HTML3 destination. To change the tagset template that generates HTML 4.0 tags
(from the <TH> tag to a <TD> tag ), you would have to use PROC TEMPLATE with the syntax for TAGSET templates to
change the event that was responsible for writing out the <TH> tag.

For example, the HTML4 tagset inherits from the HTMLCSS tagset.
It is in the HTMLCSS tagset that you find this Define Block for the Header Event:
[pre]
define event header;
start:
put "<th"; /* change this line to td */
putq " title=" flyover;
trigger classalign;
trigger style_inline;
trigger rowcol;
put ">";
trigger cell_value;

finish:
trigger cell_value;
put "</th>" NL; /* change this line also to td */
end;

[/pre]

You would need to alter this event's action with PROC TEMPLATE code to change the 'th' to 'td' -- is it do-able?? Yes, absolutely.
But, it's different, so there will be a learning curve, because understanding event processing and changing tagsets
will be entirely different from writing a SAS program.
For one thing, you have to worry about making sure that all the
parent and grandparent tagsets used by your new tagset are identified and available to the new tagset.

For more help with modifying the tagset template, your best bet for help is to contact Tech Support if you really want to go down this road.

cynthia
Ask a Question
Discussion stats
  • 3 replies
  • 129 views
  • 0 likes
  • 2 in conversation