Hi,
I have a listgrid with a column/field with a displayfield, I can only sort once on this field, a second click on the column header to sort the opposite direction is ignored.
This can be reproduced with an example where the listgrid is backed by a datasource (the examples with just an array as the data work fine), for example the feature explorer: dataSourceFields
Use this code:
Then click on the column header, it is sorted. Click again, the sort action is ignored.
This happens in 8.3 using the latest nightly. For the following case:
- the listgrid has a datasource
- the field does not have a datasource
- the field has a displayField set and the displayField does not occur as a 'normal' field in the grid
- the displayField is not present in the datasource fields set either, but the displayField is present in the data
This is the case for the dataSourceFields example with the code provided above.
It works fine in 8.1.
The issue seems to be in the ListGrid.setSort method, at the second click it gets a sortspecifier with an object which has the displayField as the property. If the displayField is not a field in the grid it won't find it using the ListGrid.getUnderlyingField method.
In 8.3 a new newSpecifiers variable was introduced which is only filled if the field was found, in 8.1 the code continued with the old sortSpecifier.
gr. Martin
I have a listgrid with a column/field with a displayfield, I can only sort once on this field, a second click on the column header to sort the opposite direction is ignored.
This can be reproduced with an example where the listgrid is backed by a datasource (the examples with just an array as the data work fine), for example the feature explorer: dataSourceFields
Use this code:
Code:
isc.ListGrid.create({ ID: "countryList", width:500, height:224, alternateRecordStyles:true, dataSource: countryDS, fields:[ {name:"countryName", title:"Country", displayField: 'government'} ], autoFetchData: true })
This happens in 8.3 using the latest nightly. For the following case:
- the listgrid has a datasource
- the field does not have a datasource
- the field has a displayField set and the displayField does not occur as a 'normal' field in the grid
- the displayField is not present in the datasource fields set either, but the displayField is present in the data
This is the case for the dataSourceFields example with the code provided above.
It works fine in 8.1.
The issue seems to be in the ListGrid.setSort method, at the second click it gets a sortspecifier with an object which has the displayField as the property. If the displayField is not a field in the grid it won't find it using the ListGrid.getUnderlyingField method.
In 8.3 a new newSpecifiers variable was introduced which is only filled if the field was found, in 8.1 the code continued with the old sortSpecifier.
gr. Martin
Comment