Datagrid Table - How to read the row order
Posted: Tue Feb 21, 2017 10:18 am
Hi,
I have been reading the Datagrid API but still seek enlightenment. I have a standard datagrid table that allows the user to sort the rows by selecting the column headings. I wish to extract the data in the same order as it is being displayed. The simple answer is to use the dgText[true] command which returns a TSV copy of the data in the display order with headings.So thats o.k. ??
However, the API implies that the dgText command is for wimps "in the interest of making life easier for some folks there is the dgText property". So real non-folksy (is that a word?) programmers use the dgData property. As far as I can see this returns the data in an unordered array.
The property "sort by column" returns the column being used to sort the data but it does not return the sort direction i.e. ascending / descending and I cannot find a property that does return the direction.
Now I expect that I have missed something obvious, can you shed some light or am I just going to accept that I am one of those folks who uses dgText?
I have been reading the Datagrid API but still seek enlightenment. I have a standard datagrid table that allows the user to sort the rows by selecting the column headings. I wish to extract the data in the same order as it is being displayed. The simple answer is to use the dgText[true] command which returns a TSV copy of the data in the display order with headings.
Code: Select all
put the dgText[true] of group "dgNotes" into tData -- TSV in display order
However, the API implies that the dgText command is for wimps "in the interest of making life easier for some folks there is the dgText property". So real non-folksy (is that a word?) programmers use the dgData property.
Code: Select all
put the dgData of group "dgNotes" into tDataA
The property "sort by column" returns the column being used to sort the data but it does not return the sort direction i.e. ascending / descending and I cannot find a property that does return the direction.
Code: Select all
put the dgProp["sort by column"] of group "dgnotes" into tSortCol