flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mihai Chira <mihai.ch...@gmail.com>
Subject Re: [jira] [Updated] (FLEX-34852) Allow sorting by complex fields in ListCollectionView
Date Fri, 22 May 2015 15:29:37 GMT
See, I'm glad I started this dialogue. Indeed, I was just planning to
detect complex sort fields by the presence of a "." in them. Now,
after writing a simple unit test, I realised that dynamic Objects can
have fields with "." in them by saying obj["field.with.dot"] = 1; But
I also just noticed that DataGrid does exactly the same (assume that a
dataField with a "." in it implies a complex field. See
spark.components.gridClasses.GridColumn.set dataField), and that you
cannot bind to fields with "." in them.

Should we then 1) allow for dots in object fields and thus also change
GridColumn somehow? or 2) just assume that people won't sort by
properties with dots in them unless they're complex fields?

On 22 May 2015 at 17:10, Alex Harui <aharui@adobe.com> wrote:
> OK, well you got me worried by saying it would be a “rather consequential
> change”.  Are you going to add a property to SortField like
> “complexSortEnabled” and switch between old behavior and new behavior that
> way?  I don’t think you can just presume that “.” means complex field in
> case folks are sorting on a field name that just happens to have a “.” in
> it.
>
> -Alex
>
> On 5/22/15, 7:58 AM, "Mihai Chira" <mihai.chira@gmail.com> wrote:
>
> >From what I see in the code, it's possible to use SortField and not
>>break backward compatibility; if it won't be the case, I'll consider
>>doing that. (As usual when refactoring, I'm creating unit tests for
>>existing functionality to increase the certainty that existing
>>functionality still works as before.)
>>
>>On 22 May 2015 at 16:46, Alex Harui <aharui@adobe.com> wrote:
>>> It might be possible to add a ComplexSortField class here and have it do
>>> the extra work without breaking backward compatibility.
>>>
>>> -Alex
>>>
>>> On 5/22/15, 7:41 AM, "Mihai Chira" <mihai.chira@gmail.com> wrote:
>>>
>>>>Because this can be a rather consequential change, I thought I'd ask
>>>>whether people think it's a good idea before I finish coding it. If
>>>>it's something you've worked with, or your application uses heavily,
>>>>let me know what you think, or ask me details about it. Otherwise we
>>>>can just do our commit-then-review process.
>>>>
>>>>On 22 May 2015 at 16:34, Mihai Chira (JIRA) <jira@apache.org> wrote:
>>>>>
>>>>>      [
>>>>>https://issues.apache.org/jira/browse/FLEX-34852?page=com.atlassian.jir
>>>>>a.
>>>>>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.
>>>>>
>>>>>   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}
>>>>>
>>>>>
>>>>>> 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.
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> This message was sent by Atlassian JIRA
>>>>> (v6.3.4#6332)
>>>
>

Mime
View raw message