[ 
https://issues.apache.org/jira/browse/FLEX-35222?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Devsena updated FLEX-35222:
---------------------------
    Attachment: DataGridSortingExample.zip

I'm presently working on a very basic implementation to DataGrid sorting. This 
still in it's initial stage but it able to sort columns at runtime. Requested 
Peter or any one to review the source and advise if we're on right track and if 
we need to continue our effort. I'm attaching herewith the example project 
(DataGridSortingExample.zip) that sorts, and following are a few custom classes 
which we've created for this goal. 

*PNDataGridButtonBarButtonItemRenderer:* The class extended by 
_ButtonBarButtonItemRenderer_ which creates the button component as column 
header and listen to it's click event. The class override to pass our custom 
events with requisite information; along with showing an icon for 
ascending/descending sort position. 

*PNDataGridColumnSorter:* A bead which can be added to DataGrid component 
class, and should supply with same field references as we supply for 
_PNDataProviderChangeNotifier_ class - *sourceID*, *propertyName* - the class 
reference holding the ArrayList collection to DataGrid, and the field name for 
the ArrayList respectively. The class catches the event fired by 
_PNDataGridButtonBarButtonItemRenderer_, sort the array per column index (from 
which column the event fired), updates the main ArrayList and also re-renders 
the DataGrid. 

*Known issues:*
# Sorting icon remains to the column once sorted. It suppose to get hidden when 
another column sorted

Let me your views.

> DataGrid doesn't support sorting on fields
> ------------------------------------------
>
>                 Key: FLEX-35222
>                 URL: https://issues.apache.org/jira/browse/FLEX-35222
>             Project: Apache Flex
>          Issue Type: Improvement
>          Components: FlexJS
>    Affects Versions: Apache FlexJS 0.8.0
>            Reporter: Pan Li
>         Attachments: DataGridSortingExample.zip, jqueryeasyui.jpg, safari.jpg
>
>
> Sample of current implementation: 
> taken directly from SDK DataGridExample
> !safari.jpg!
> expected:
> Gird should support sorting on fields 
> !jqueryeasyui.jpg!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to