Sharing new technologies with the community

 
alt

Chris Connor

 
Follow ChrisJConnor on Twitter
Chat with me

jQuery Domino Goodies #2 - Sorting within categorised Web Views

Chris Connor  November 17 2009 05:11:53 AM
This builds on the article posted in #1 - simple sortable HTML tables. Again we use jQuery - this time we "wrap" an accordion around each category and build a table. The idea is that you click on a "category" and it shows (actually fades in) a sortable table as shown below

Image:jQuery Domino Goodies #2 - Sorting within categorised Web Views

In terms of js / css files that you need to import you need the same set as the last ones AND the UI Core js files that I mention below.

Image:jQuery Domino Goodies #2 - Sorting within categorised Web Views

Next we need a $$ViewTemplate similar to the table example in the prvious article.

Image:jQuery Domino Goodies #2 - Sorting within categorised Web Views

Next we need the view. Firstly categorise and if required add a couple of sort columns. We are in essence building a table for each category. The first critical piece in this part of the jigsaw is the the first "HTML column" shown below - ensure this column is categorised.

Image:jQuery Domino Goodies #2 - Sorting within categorised Web Views

Then build table cells and terminate using the column below

Image:jQuery Domino Goodies #2 - Sorting within categorised Web Views

Lastly we need to set the javascript to set up the table sorters and add the events for collapsing / expanding the categories. This is where jQuery really comes into it's own. The power of jQuery is that using a few lines of code you can attach events / functions and just about anything you want to any elements on a form - have a look...

Image:jQuery Domino Goodies #2 - Sorting within categorised Web Views

That's it!! We attach the tablesorting routine to all the specified elements with class ".tablesort" and then do a similar thing with the category headers - that's 5 or 6 lines of Javascript!!!

Next Steps... we are working on an xPages version of this application / functionality - more details to come in the next month or two.

About Me

Notes / Domino consultant with 15 years experience. Focus on XPages, Java / JSF, RCP, jQuery, Dojo, Mobile development to add to traditional Notes / Domino, HTML, CSS and Javascript skills.

My day job is building Web 2.0 Social business applications for my customers. This blog discusses the issues in delivering these modern collaborative solutions.

I am available for hire through my business BSS IT Solutions. We are an IBM Lotus Business Partner based in Scotland serving the UK and beyond!