Community-Credit.com | NonProfitWays.com | SOAPitstop.com   Skin:   
      User: Not logged in 
Home
Newsletter Signup
XSLT Library
Latest XML Blogs
Featured Examples
Presentations
Featured Articles
Book Chapters
Training Courses
Events
NewsGroups
 
Discussions
Examples
Tutorials
Tools
Articles
Resources
Websites
 
Sign In
My Profile
My Articles
My Examples
My Favorites
My Resources
Add a Resource
Logout
 
About Me
My Blog
HeadGeek Articles
Talking Portfolio
Resume
Pictures
World Trip Pics


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

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.

One very sexy aspect of this implementation is that it makes use of 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.

Additional Notes: Well, the full sourcecode is downloadable. However, the cliffnotes are shown below. The sourcecode is documented as well and will explain it all.

a) To add the ability to highlight the current row and "sort by clicking on the column header" you will need to simply add the behavior to the table as follows: <table style="Behavior: url(TableSortAndHighlight.htc)"....> b) To indication which xml attribute in the xml document is sorted when you click on the column header, just add the "SortField" attribute to the html table column. Examples are as follows:

<td SortField="FirstName".....
<td SortField="LastName".....
<td SortField="ResidenceType".....
<td SortField="ResidenceType"....
<td SortField="State">State.....


Yes, this assumes that the xml document is attribute normalized, but it is not a very big leap to modify to handle xml documents that are element normalized.


Download this demo
SortingDataIslands.zip




























































































Fans of "The Office"
Dwight Bobbleheads are here!

  “It's me! I'm the bobblehead! Yes!”



Advertise on XMLPitstop

Advertise on XMLPitstop


EggHead Cafe
Web Servicee development
DotNetSlackers
Discount ink cartridges
professional halloween costume
efax
conference call service
chicago web design
Alojamiento de Web
UK Web Hosting
NVR Network Video Recorder
Diesel sunglasses
Video Surveillance
VoIP Internettelefonie AT

4,173 Total Members
5 members(last 30 days)
0 members(last 7 days)
0 members(today)

1,948 Total Discussions
0 Posts(last 30 days)
0 Posts(last 7 days)
0 Posts(today)

47,487 Total Blog Posts
0 Blogs(last 30 days)
0 Blogs(last 7 days)
0 Blogs(today)

8,699 Newsgroup Posts
0 Posts(last 30 days)
0 Posts(last 7 days)
0 Posts(today)

14,140 Total Resources
0 Resources(last 30 days)
0 Resources(last 7 days)
0 Resources(today)