You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This results in a column that is identified as sortable but when a sort is attempted by clicking on the column header an error is thrown. "Unknown column Person.Name"
In this example, the column is not sortable (though it really should be because we are just manipulating the appearance of the data from a column).
Currently GridFieldSortableHeader@getHTMLFragments is failing to correctly identify if dot notation is just a style manipulation or if it's a relationship. If it's a relationship, it's failing to correctly work out the relation field to sort on.
I think the logic in getHTMLFragments is too complex as it is written to work out an infinite level of nesting (though breaks out on SS_List instances which is surely the only time infinite nesting could work?!).
I propose we limit the logic to assume there can only be a maximum of 3 levels of nesting. (Relation.Field.Format / Field.Format / Relation.Field / Field). Perhaps even assuming that the format would default to "Nice"? [edit: removed as not a job for sortable headers]
This would allow simpler code and for clearer documentation.
The text was updated successfully, but these errors were encountered:
sminnee
changed the title
GridFieldSortableHeader can't handle dot notation properly
DataList::canSortBy can't handle dot notation properly
May 10, 2017
There are two instances using dot notation that fail where I think it should work. Take the following examples:
Example 1 - Bad sort resolution
This results in a column that is identified as sortable but when a sort is attempted by clicking on the column header an error is thrown. "Unknown column Person.Name"
Example 2 - Fail to resolve formatted fields
In this example, the column is not sortable (though it really should be because we are just manipulating the appearance of the data from a column).
Currently
GridFieldSortableHeader@getHTMLFragments
is failing to correctly identify if dot notation is just a style manipulation or if it's a relationship. If it's a relationship, it's failing to correctly work out the relation field to sort on.I think the logic in
getHTMLFragments
is too complex as it is written to work out an infinite level of nesting (though breaks out onSS_List
instances which is surely the only time infinite nesting could work?!).I propose we limit the logic to assume there can only be a maximum of 3 levels of nesting. (
Relation.Field.Format
/Field.Format
/Relation.Field
/Field
).Perhaps even assuming that the format would default to "Nice"?[edit: removed as not a job for sortable headers]This would allow simpler code and for clearer documentation.
The text was updated successfully, but these errors were encountered: