-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Column sort doesn't work with get function #149
Comments
The thing is, sorting happens against the data (or store, if one is involved), whereas
Sort directly correlates to columns' designated Sorry for the delay on this reply. Let us know if you have any other related questions; otherwise we can close this out. Thanks! |
The data I used in the issue was just illustrative. The actual usage I have is more like this: var data = [
{ name: "Bob", total: 10, correct: 7 },
{ name: "Vanna", total: 12, correct: 11 },
{ name: "Pat", total: 6, correct: 6 }
]; [
{ label: "Name", field: "name" },
{ label: "Average", get: function(d){ return Math.round(d.correct/d.total) + "%"; } }
] There is obviously no field I can specify to get the desired order. I am working around it by modifying the underlying data to have an additional column. Perhaps the sort arrows shouldn't be present if the data cannot be sorted (that is, if a 'field' has not been specified in the column definition.) |
Good point RE disabling sort for fieldless columns; I've fixed that in 4b55763. |
Given this data:
And this columns definition:
The grid displays properly, but the "Name" column is not sortable. The asc/desc sort triangle flips, but the rows do not sort.
The text was updated successfully, but these errors were encountered: