You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flex.apache.org by "Mihai Chira (JIRA)" <ji...@apache.org> on 2015/06/07 18:26:00 UTC

[jira] [Updated] (FLEX-34852) Allow sorting by complex fields in ListCollectionView

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

Mihai Chira updated FLEX-34852:
-------------------------------
    Description: 
Currently the only way to sort by complex fields (e.g. "address.street") is to not specify any sort fields and to use a custom compare function which knows which fields to check.

*Expected behaviour*: The code below sorts the items by the address.street field:

{code}
const sortByNameAscending:Sort = new Sort();
sortByNameAscending.fields = [new SortField("address.street", false, false)];
_sut.sort = sortByNameAscending;
{code}

*Note* this will allow FLEX-34837 to be fixed.
*Note* you can follow / join the discussion [here|http://mail-archives.apache.org/mod_mbox/flex-dev/201505.mbox/%3CCAP1cEXENUHwhf82Ja_OLZ6dh%2BN4R1z2sXCTDvZ1c24GX-q5R7Q%40mail.gmail.com%3E].

  was:
Currently the only way to sort by complex fields (e.g. "address.street") is to not specify any sort fields and to use a custom compare function which knows which fields to check.

*Expected behaviour*: The code below sorts the items by the address.street field:

{code}
const sortByNameAscending:Sort = new Sort();
sortByNameAscending.fields = [new SortField("address.street", false, false)];
_sut.sort = sortByNameAscending;
{code}

*Note* this will allow FLEX-34837 to be fixed.


> Allow sorting by complex fields in ListCollectionView
> -----------------------------------------------------
>
>                 Key: FLEX-34852
>                 URL: https://issues.apache.org/jira/browse/FLEX-34852
>             Project: Apache Flex
>          Issue Type: New Feature
>          Components: Collections, Spark: Sort and SortField
>    Affects Versions: Apache Flex 4.14.1
>            Reporter: Mihai Chira
>            Assignee: Mihai Chira
>             Fix For: Apache Flex 4.15.0
>
>
> Currently the only way to sort by complex fields (e.g. "address.street") is to not specify any sort fields and to use a custom compare function which knows which fields to check.
> *Expected behaviour*: The code below sorts the items by the address.street field:
> {code}
> const sortByNameAscending:Sort = new Sort();
> sortByNameAscending.fields = [new SortField("address.street", false, false)];
> _sut.sort = sortByNameAscending;
> {code}
> *Note* this will allow FLEX-34837 to be fixed.
> *Note* you can follow / join the discussion [here|http://mail-archives.apache.org/mod_mbox/flex-dev/201505.mbox/%3CCAP1cEXENUHwhf82Ja_OLZ6dh%2BN4R1z2sXCTDvZ1c24GX-q5R7Q%40mail.gmail.com%3E].



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

Re: [jira] [Updated] (FLEX-34852) Allow sorting by complex fields in ListCollectionView

Posted by Mihai Chira <mi...@gmail.com>.
Now there's a first version of ListCollectionView being able to
monitor changes to complex fields in order to resort its items (see my
recent commits). All suggestions / comments are welcome, especially
about ComplexFieldChangeWatcher.Closure - is there a better way to do
what this class is doing?


What's left to do:
0. Figure out and fix
TEST-ListCollectionView_Sort_Tests.test_sort_fields_on_complex_objects_dont_change_unless_sort_reapplied()
1. Deal (if needed) with CollectionEventKind.UPDATE events in
ComplexFieldChangeWatcher
2. Update asdocs for new classes / fields
3. Add more unit tests (e.g. wrapped collections, sorting + filtering,
different timings, etc.)
4. Once all that seems to be working well, move the logic onto the
spark SortField and Sort classes too
5. Get DataGrid to rely on this method for keeping track of changes to
complex fields than the buggy system it has now.

On 7 June 2015 at 18:26, Mihai Chira (JIRA) <ji...@apache.org> wrote:
>
>      [ https://issues.apache.org/jira/browse/FLEX-34852?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
>
> Mihai Chira updated FLEX-34852:
> -------------------------------
>     Description:
> Currently the only way to sort by complex fields (e.g. "address.street") is to not specify any sort fields and to use a custom compare function which knows which fields to check.
>
> *Expected behaviour*: The code below sorts the items by the address.street field:
>
> {code}
> const sortByNameAscending:Sort = new Sort();
> sortByNameAscending.fields = [new SortField("address.street", false, false)];
> _sut.sort = sortByNameAscending;
> {code}
>
> *Note* this will allow FLEX-34837 to be fixed.
> *Note* you can follow / join the discussion [here|http://mail-archives.apache.org/mod_mbox/flex-dev/201505.mbox/%3CCAP1cEXENUHwhf82Ja_OLZ6dh%2BN4R1z2sXCTDvZ1c24GX-q5R7Q%40mail.gmail.com%3E].
>
>   was:
> Currently the only way to sort by complex fields (e.g. "address.street") is to not specify any sort fields and to use a custom compare function which knows which fields to check.
>
> *Expected behaviour*: The code below sorts the items by the address.street field:
>
> {code}
> const sortByNameAscending:Sort = new Sort();
> sortByNameAscending.fields = [new SortField("address.street", false, false)];
> _sut.sort = sortByNameAscending;
> {code}
>
> *Note* this will allow FLEX-34837 to be fixed.
>
>
>> Allow sorting by complex fields in ListCollectionView
>> -----------------------------------------------------
>>
>>                 Key: FLEX-34852
>>                 URL: https://issues.apache.org/jira/browse/FLEX-34852
>>             Project: Apache Flex
>>          Issue Type: New Feature
>>          Components: Collections, Spark: Sort and SortField
>>    Affects Versions: Apache Flex 4.14.1
>>            Reporter: Mihai Chira
>>            Assignee: Mihai Chira
>>             Fix For: Apache Flex 4.15.0
>>
>>
>> Currently the only way to sort by complex fields (e.g. "address.street") is to not specify any sort fields and to use a custom compare function which knows which fields to check.
>> *Expected behaviour*: The code below sorts the items by the address.street field:
>> {code}
>> const sortByNameAscending:Sort = new Sort();
>> sortByNameAscending.fields = [new SortField("address.street", false, false)];
>> _sut.sort = sortByNameAscending;
>> {code}
>> *Note* this will allow FLEX-34837 to be fixed.
>> *Note* you can follow / join the discussion [here|http://mail-archives.apache.org/mod_mbox/flex-dev/201505.mbox/%3CCAP1cEXENUHwhf82Ja_OLZ6dh%2BN4R1z2sXCTDvZ1c24GX-q5R7Q%40mail.gmail.com%3E].
>
>
>
> --
> This message was sent by Atlassian JIRA
> (v6.3.4#6332)