Four Js Development Tools Forum

Discussions by product => Genero BDL => Topic started by: SSL D. on May 11, 2010, 12:47:50 pm



Title: Column Sort
Post by: SSL D. 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.



Title: Re: Column Sort
Post by: Sebastien F. 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


Title: Re: Column Sort
Post by: Sebastien F. 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


Title: Re: Column Sort
Post by: Reuben B. 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