Skip to content
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

DataTable Methods clearSorter bug #5909

Open
2 of 5 tasks
deiiviidas opened this issue Apr 28, 2024 · 3 comments
Open
2 of 5 tasks

DataTable Methods clearSorter bug #5909

deiiviidas opened this issue Apr 28, 2024 · 3 comments
Labels
untriaged need to sort

Comments

@deiiviidas
Copy link

deiiviidas commented Apr 28, 2024

Describe the bug

while datatable columns is like that and using tableRef.value?.clearSorter() wont clear active sort state from table th.

// minimal example //
DataTableColumns => {
return [
{
width: getWidth('title'),
title: 'Task title',
key: 'taskTitle',
sorter: true,
},
]
}

so only by using this tableRef.value?.sort('taskTitle', false) resets sort - so it doesnt matter what columnKey i set, it must exist in table columns, so by setting any existing to false, it resets for all table. thus acting like tableRef.value?.clearSorter()

its very anoying to search how to hack this shit to work properly...

Steps to reproduce

sorter: true,

and then set/use ref for table

Link to minimal reproduction

null

System Info

latest version

Used Package Manager

npm

Validations

@deiiviidas deiiviidas added the untriaged need to sort label Apr 28, 2024
@deiiviidas
Copy link
Author

image

@jahnli
Copy link
Collaborator

jahnli commented Apr 30, 2024

Provide the repetition of [minimum recurring example] (https://stackoverflow.com/help/minimal-reproducible-example)

@deiiviidas
Copy link
Author

deiiviidas commented Apr 30, 2024

Provide the repetition of [minimum recurring example] (https://stackoverflow.com/help/minimal-reproducible-example)

NO.

System is more complicated, its needs backend to fully be functional. becouse it is using @update:sorter to send requests which eventually updates data to table. which is being sorted out, from naive-ui -> backend -> naive ui - active sort indicates what is sorting state and what columnKey needs to be sorted. while sorted: true - it is "controlled" ish sorter.

@deiiviidas deiiviidas changed the title DataTable Methods clearSorter bug DataTable Methods clearSorter bug (uncontrolled sort) May 1, 2024
@deiiviidas deiiviidas changed the title DataTable Methods clearSorter bug (uncontrolled sort) DataTable Methods clearSorter bug May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged need to sort
Projects
None yet
Development

No branches or pull requests

2 participants