Websydian v6.1 online documentationOnline documentation - Websydian v6.1

FAQ - Sortable grid columns

Product Websydian WebDeveloper
Version All
Category General
Question How to make columns sort able during runtime by pressing the header cell
Answer Using a full load WebgridPage with javascript to perform sorting (much like the gui approach)
  1. Create a webgridpage enabling full load more info http://www.websydian.com/websydiandoc/WsyUtil/Standard/WebGridPage.htm
  2. Using java script in the document template an example can be found at http://www.kryogenix.org/code/browser/sorttable/ or http://www.activewidgets.com/grid/

Pros:

  • Easy to implement
     

Cons:

  • Not very suiteable for large data amounts.
    Uses javascript in the page instead of code in model.

 

Using a number of views and blockfetch functions from Plex

  1. Create a view and blockfetch for each of the sort types you need.
  2. Create a webgridpage with an input field indicating which sort method to be used.
  3. Create a blockfetch shell which takes an input field indicating sort field. And of course has all other fields as a normal blockfetch.
  4. Replace the blockfetch on the webgridpage with the blockfetch shell.
  5. Create events for each of the sort fields and call the webgridpage identifying the sort field to use.
  6. Make changes to the document template moving the events to the correct location (in the th tag)

Pros:

  • Handles large amounts of data
  • All code is in the model.


Cons:

  • Not as easy to implement
  • Special considerations required to handle positioning.

I hope this gives you some ideas on possible solutions and you might even found another approach based on this.