Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Column Sort  (Read 8320 times)
SSL D.
Posts: 11


« on: May 11, 2010, 12:47:50 pm »

Hi,

How can we find out (In Code) which column has been selected for ordering the data in a table.

We wish to output the array data to Excel or a Printer in the order in which the client is currently viewing it.

Sebastien F.
Four Js
Posts: 509


« Reply #1 on: May 11, 2010, 02:18:20 pm »

Hi,

By using the om API, you can query the AUI tree, and look at the Table node for "sortColumn" and "sortType" attributes.

=> sortColumn is the index of the TableColumn node in the Table node (does not matter if columns have been moved around).

Seb
Sebastien F.
Four Js
Posts: 509


« Reply #2 on: May 11, 2010, 02:25:09 pm »

Note that for next release (2.30), we are working on Drag & Drop and with this feature comes a new serialization method to copy all or selected rows into a string. The string holds is tab-separated values (TSV), we would also like to do comma-separated values (CSV), and than can be dropped into excel.

Seb
Reuben B.
Four Js
Posts: 1062


« Reply #3 on: May 12, 2010, 12:53:41 am »

Hi Kevin,

To save you reinventing the wheel, have a look at http://code.google.com/p/sourcefourjs/wiki/auitree and the download http://code.google.com/p/sourcefourjs/downloads/detail?name=auitree_1_0.zip

One of the folder tabs has an example of copying the entire array to clipboard taking into account things like column sort-order, hidden and moved columns.  I think the only thing it couldn't cater for was the use of TABINDEX.  I first wrote a similar routine in about 2004 as in my previous job we figured Copy Visible Table was impractical and users would want to copy the entire array, not just what they could see on screen.  Using the pre-processor, it was able to be implemented such that it was automatically available on every array.

Reuben

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines