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
In the current API, each column options object has a "sortDirection" property. This can lead to ambiguity if multiple columns have this field set. I would propose to change the API to work similarly to the jQuery Datatables plugin. Instead of this being handled at the column level, it would be handled at the table level. A new property "order" could be added to the table options. The property would be an array of objects. Example:
Additionally, the property could be setup to just take in an object:
order: {name: 'office', direction: 'asc'},
In this case, it would know there is only 1 field for sorting.
The reason to allow an array is because sometimes having a secondary or tertiary sort is useful. You can see an example of this on the table at datatables.net: https://datatables.net/ - first click the "Office" field, then hold SHIFT and click the "Age" field. The table sorts by the Office field, and then entries with the same office get sorted by Age.
Most of the time you only want to sort by 1 field, but in certain cases it is quiet useful to have the ability to add a secondary sort. The downsides are that visually, if you were to just look at the arrows, you wouldn't known the primary sort field. This could possibly be mitigated by lightening the color of successive sort arrows. Or just allowing the user to infer, as the datatables.net plugin does. The other downside is that this is a power-user feature - most people don't know to click SHIFT to add a secondary sort. But some users really like the ability to do this.
The text was updated successfully, but these errors were encountered:
Creating from comment in #605.
In the current API, each column options object has a "sortDirection" property. This can lead to ambiguity if multiple columns have this field set. I would propose to change the API to work similarly to the jQuery Datatables plugin. Instead of this being handled at the column level, it would be handled at the table level. A new property "order" could be added to the table options. The property would be an array of objects. Example:
Additionally, the property could be setup to just take in an object:
In this case, it would know there is only 1 field for sorting.
The reason to allow an array is because sometimes having a secondary or tertiary sort is useful. You can see an example of this on the table at datatables.net: https://datatables.net/ - first click the "Office" field, then hold SHIFT and click the "Age" field. The table sorts by the Office field, and then entries with the same office get sorted by Age.
Most of the time you only want to sort by 1 field, but in certain cases it is quiet useful to have the ability to add a secondary sort. The downsides are that visually, if you were to just look at the arrows, you wouldn't known the primary sort field. This could possibly be mitigated by lightening the color of successive sort arrows. Or just allowing the user to infer, as the datatables.net plugin does. The other downside is that this is a power-user feature - most people don't know to click SHIFT to add a secondary sort. But some users really like the ability to do this.
The text was updated successfully, but these errors were encountered: