BizTalk Utilities CV ,   Jobs ,   Code library
 
Home Page


Add/Edit your code items
Search the code library
Browse for the code library


JavaScript
Simple JS Menu Tree using XSLT
xml report writer
Filtering Data Islands
Small XML/XSL application with JavaScript
Table Column sorting using XML, XSL and JavaScript
Display of Hierarchical Data Islands
x++ beta 0.2 release (includes ISAPI filter/interpreter)
HTTP File Commander
XML Ticker
Fading Ticker
How to understand the flow of control in XLST
Begginers, search the Bible
JavaScript Ticker (using Tabular Data Control)
-postfix.aspx>Infix <> Postfix
Nested Tables And Data Island
XML Data Traversal
TrimWhiteSpace
Two Tier Data Islands with Expanding/Collapsing Child elements.
Escape special characters using JavaScript and regular expressions
Sticky Table Headers


 
 

 LAMP >>


By David Silverlight
First Posted 12/24/2001
Times viewed 2732

Sorting Data Islands by clicking on the column header (using behaviors).


This post contains attachments
v20011224002119.zip 

Summary This snippet demonstrates how to use behaviors to Sort a table by clicking on the column header. It also uses behaviors to highlight the row when moving the mouse over it.

View This Snippet in Action

This snippet demonstrates adding the following two functionalities to an Databound HTML table:

a) Allowing the user to sort the table in ascending/descending order when the column header is clicked.
b) Highlighting the current row when the user mouses over it as well as highlighting the selected row when the user clicks on it.

Well, the concept has been done before by Trace and many of the other talented folks in this group. However, this particular implementation involves behaviors. Using behaviors, the snippet demonstrates how to add this functionality without having to add alot of javascript/vbscript code each time around. Simply add the behavior to your table and the functionality comes along with it. Since I have to add this type of functionality to just about every single HTML table that I create in a web application, this saves tons of time. You can also check it out in action at XMLPitstop -

Changes on 02/16/2002:

  • Corrected a minor bug that I found in the .htc file.
  • Optimized the code a bit by combining the functionality into a single behavior file. If you are using multiple databound html tables on a page, this will result in noticeably improved performance.

Additional information


Rate this article on a scale of 1 to 10 (2 votes, average 4)

Your vote :  

 LAMP >>





Leave a comment for this article
Your name
Your email (optional)
Your comment
Optional: Upload an attachment
Enter the code shown:

 
 

    Email TopXML