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
- The path is split on dots and resolved step by step: `user.address.city`.
1050
+
- Missing or `null` nested values are pushed to the bottom for ascending order (and top for descending) because `null/undefined` are treated as greater than defined values in asc ordering.
1051
+
- Works the same for client-side sorting and for server-side loaders: when using an async loader the same `sortField` (e.g. `user.address.city`) is passed so you can implement equivalent ordering on the backend.
1052
+
- Date objects at nested paths are detected and compared chronologically.
1053
+
- Numeric comparison is stable for mixed numeric strings via Intl.Collator with numeric option.
1054
+
1055
+
Edge cases to consider in your own data:
1056
+
- Deeply missing branches like `user.profile.settings.locale` simply result in `undefined` and will follow the null ordering logic above.
1057
+
- Arrays are not traversed; if you need array-specific sorting you should pre-normalize data into scalar fields before passing to the table.
1058
+
1059
+
### Server-side sorting
1060
+
1061
+
When you provide an async function to `data`, the table will pass the current sort along with pagination params.
1062
+
1063
+
Signature of the loader receives:
1064
+
1065
+
```ts
1066
+
typeLoaderArgs= {
1067
+
offset:number;
1068
+
limit:number;
1069
+
sortField?:string; // undefined when unsorted
1070
+
sortDirection?:'asc'|'desc'; // only when sortField is set
@sort-change="({ field, direction }) => console.log('sort changed', field, direction)"
1108
+
/>
1109
+
```
1110
+
976
1111
### Table loading states
977
1112
978
1113
For tables where you load data externally and pass them to `data` prop as array (including case with front-end pagination) you might want to show skeleton loaders in table externaly using `isLoading` props.
0 commit comments