Skip to content

Commit

Permalink
closes #4166 docs: DataTable sorting section write about disableClien…
Browse files Browse the repository at this point in the history
…tSideSorting (#4181)
  • Loading branch information
khurram-ansari committed Mar 14, 2024
1 parent 293c1bc commit 5dcd72c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/docs/page-config/ui-elements/data-table/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default definePageConfig({
block.paragraph("You can also provide a custom sorting function for a given column using the `sortingFn` field on the column definition object: `sortingFn: (a: any, b: any) => number`. The function takes two cells' initial values (a, b) (**note: initial values** (i.e. in the form the user provided them, rather than stringified)) and must return a number (-1, 0, +1) indicating whether the two rows should be swapped the places or not. See the standard JS's [Array.prototype.sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)[[target=_blank]] for details. If you want to runtime-disable the custom function and start making use of the built-in one, pass the `undefined` to the `sortingFn`."),
block.paragraph("You can also provide a custom display format function for a given column using the `displayFormatFn` field on the column definition object: `displayFormatFn: () => 'Overridden string',`The function takes in any value of any type and will allow full control over the displayed value.`"),
block.paragraph("`va-data-table` also optionally accepts the `sort-by` and the `sorting-order` modeled props, which allow users to change sorting settings from-outside and to model the changes introduced to the table's sorting by interacting with the table itself. They also allow to provide initial sorting values. **Properties work through the `v-model`**."),
block.paragraph("By default, `va-data-table` utilizes client-side sorting. However, when using server-side sorting use the `disableClientSideSorting` prop to prevent dual re-ordering."),
block.example("Sorting", { hideTitle: true }),

block.headline("Selection"),
Expand Down

0 comments on commit 5dcd72c

Please sign in to comment.