PhenoApps / Field-Book

https://fieldbook.phenoapps.org
GNU General Public License v2.0
53 stars 54 forks source link

Datagrid sort fix #951

Closed bellerbrock closed 7 months ago

bellerbrock commented 7 months ago

Description

Provide a summary of your changes including motivation and context. If these changes fix a bug or resolves a feature request, be sure to link to that issue.

closes #906

Type of change

What type of changes does your code introduce? Put an x in boxes that apply.

Checklist:

Changelog entry

Please add a one-line changelog entry below. This will be copied to the changelog file during the release process.

Datagrid sorting updated to match plot sorting
chaneylc commented 7 months ago

Looks like there is a navigation bug when clicking on data grid cells. I think originally the returned cursor would grab the first column, which would be observation_unit_id, now it looks like it grabs another column, which leads Collect activity to the wrong plot.

This probably needs to be updated to reference the column of the unique id:

//unique name column is always the first column

val uniqueIndex = cursor.getColumnIndex(cursor.getColumnName(0))
bellerbrock commented 7 months ago

Thanks Chaney. I also noticed the trait navigation wasn't working like it used to, I think because of the recent addition of the LAST_USED_TRAIT preference. let me know if the fix here looks alright.