-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Table: customSort does not work when sortMultiple is enabled #2681
Labels
Comments
kikuomax
added a commit
to kikuomax/buefy
that referenced
this issue
Dec 28, 2023
- Adds test cases that test sortable columns of BTable. Tests the following functionalities: - Sort single column - Sort multicolumns - Sort single column with custom sort Multicolumn sorting with custom sort is an issue buefy#2681
kikuomax
added a commit
to kikuomax/buefy
that referenced
this issue
Dec 28, 2023
- `BTable` now uses `customSort` of each column if exists when it sorts multiple columns. Actual sorting is done by `multiColumnSort` function defined in `src/utils/helpers.js`. To support custom sort, `multiColumnSort` changes the format of the second parameter `sortingPriority` which used to accept an array of dot-separated field paths but now accepts an array of objects with the following fields: - `field`: dot-separated field path - `order`: sort direction: - 'asc' | undefined → ascending order - 'desc' → descending order - `customSort`: function to compare two field values for sorting. The same function given to the column definition. Natural ordering is used if omitted. As far as I checked, `multiColumnSort` is only used by `BTable`. Adds test cases that test multi-column sorting with custom sort. issue buefy#2681
kikuomax
added a commit
that referenced
this issue
Dec 28, 2023
) (#3945) * test(lib): add tests around BTable sort - Adds test cases that test sortable columns of BTable. Tests the following functionalities: - Sort single column - Sort multicolumns - Sort single column with custom sort * feat(lib): support multi-column sort with custom sort - `BTable` now uses `customSort` of each column if exists when it sorts multiple columns. Actual sorting is done by `multiColumnSort` function defined in `src/utils/helpers.js`. To support custom sort, `multiColumnSort` changes the format of the second parameter `sortingPriority` which used to accept an array of dot-separated field paths but now accepts an array of objects with the following fields: - `field`: dot-separated field path - `order`: sort direction: - 'asc' | undefined → ascending order - 'desc' → descending order - `customSort`: function to compare two field values for sorting. The same function given to the column definition. Natural ordering is used if omitted. As far as I checked, `multiColumnSort` is only used by `BTable`. Adds test cases that test multi-column sorting with custom sort.
64 tasks
kikuomax
added a commit
to kikuomax/buefy
that referenced
this issue
Jan 10, 2024
…efy#2681) (buefy#3945) * test(lib): add tests around BTable sort - Adds test cases that test sortable columns of BTable. Tests the following functionalities: - Sort single column - Sort multicolumns - Sort single column with custom sort * feat(lib): support multi-column sort with custom sort - `BTable` now uses `customSort` of each column if exists when it sorts multiple columns. Actual sorting is done by `multiColumnSort` function defined in `src/utils/helpers.js`. To support custom sort, `multiColumnSort` changes the format of the second parameter `sortingPriority` which used to accept an array of dot-separated field paths but now accepts an array of objects with the following fields: - `field`: dot-separated field path - `order`: sort direction: - 'asc' | undefined → ascending order - 'desc' → descending order - `customSort`: function to compare two field values for sorting. The same function given to the column definition. Natural ordering is used if omitted. As far as I checked, `multiColumnSort` is only used by `BTable`. Adds test cases that test multi-column sorting with custom sort. - Includes migration to Vue 3, and Vue Test Utils v2: - Applies `toRaw` before testing if two columns, `column` and `currentSortColumn`, are indentical because they are reactive states. See Vue's documentation for more details: - https://vuejs.org/guide/essentials/reactivity-fundamentals.html#reactive-proxy-vs-original - https://vuejs.org/api/reactivity-advanced.html#toraw - Renames `propsData` → `props`
This was referenced Jan 24, 2024
kikuomax
added a commit
to kikuomax/buefy
that referenced
this issue
Feb 11, 2024
…efy#2681) (buefy#3945) * test(lib): add tests around BTable sort - Adds test cases that test sortable columns of BTable. Tests the following functionalities: - Sort single column - Sort multicolumns - Sort single column with custom sort * feat(lib): support multi-column sort with custom sort - `BTable` now uses `customSort` of each column if exists when it sorts multiple columns. Actual sorting is done by `multiColumnSort` function defined in `src/utils/helpers.js`. To support custom sort, `multiColumnSort` changes the format of the second parameter `sortingPriority` which used to accept an array of dot-separated field paths but now accepts an array of objects with the following fields: - `field`: dot-separated field path - `order`: sort direction: - 'asc' | undefined → ascending order - 'desc' → descending order - `customSort`: function to compare two field values for sorting. The same function given to the column definition. Natural ordering is used if omitted. As far as I checked, `multiColumnSort` is only used by `BTable`. Adds test cases that test multi-column sorting with custom sort. - Includes migration to Vue 3, and Vue Test Utils v2: - Applies `toRaw` before testing if two columns, `column` and `currentSortColumn`, are indentical because they are reactive states. See Vue's documentation for more details: - https://vuejs.org/guide/essentials/reactivity-fundamentals.html#reactive-proxy-vs-original - https://vuejs.org/api/reactivity-advanced.html#toraw - Renames `propsData` → `props`
kikuomax
added a commit
to ntohq/buefy-next
that referenced
this issue
Feb 12, 2024
…efy#2681) (buefy#3945) * test(lib): add tests around BTable sort - Adds test cases that test sortable columns of BTable. Tests the following functionalities: - Sort single column - Sort multicolumns - Sort single column with custom sort * feat(lib): support multi-column sort with custom sort - `BTable` now uses `customSort` of each column if exists when it sorts multiple columns. Actual sorting is done by `multiColumnSort` function defined in `src/utils/helpers.js`. To support custom sort, `multiColumnSort` changes the format of the second parameter `sortingPriority` which used to accept an array of dot-separated field paths but now accepts an array of objects with the following fields: - `field`: dot-separated field path - `order`: sort direction: - 'asc' | undefined → ascending order - 'desc' → descending order - `customSort`: function to compare two field values for sorting. The same function given to the column definition. Natural ordering is used if omitted. As far as I checked, `multiColumnSort` is only used by `BTable`. Adds test cases that test multi-column sorting with custom sort. - Includes migration to Vue 3, and Vue Test Utils v2: - Applies `toRaw` before testing if two columns, `column` and `currentSortColumn`, are indentical because they are reactive states. See Vue's documentation for more details: - https://vuejs.org/guide/essentials/reactivity-fundamentals.html#reactive-proxy-vs-original - https://vuejs.org/api/reactivity-advanced.html#toraw - Renames `propsData` → `props`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Overview of the problem
Buefy version: [0.8.20]
Vuejs version: [2.6.11]
OS/Browser: Windows 10/Chrome 83.0.4103.116
Description
customSort
function is not called whensortMultiple
is enabled on a Table.Steps to reproduce
sortMultiple
customSort
functioncustomSort
function gets calledExpected behavior
Table column should be sorted using the
customSort
function.Actual behavior
The column does not get sorting at all and the row order remains unchanged. No errors are reported on the console.
The text was updated successfully, but these errors were encountered: