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 deselect method should have an optional rowIndex parameter #235

Closed
RyanDubowsky opened this issue Mar 8, 2019 · 3 comments
Closed

Comments

@RyanDubowsky
Copy link

Is your feature request related to a problem? Please describe.
It would be helpful to be able to deselect one or more specific rows from the DataTable, rather than all of them (which is the current behavior of deselect).

Describe the solution you'd like
To allow for the user to specify one or more rowIndex they would like to deselect from the table.

Describe alternatives you've considered
Directly modifying the DOM gets very messy very fast.

Additional context
Separately, the documentation for DataTable should be updated to include the deselect method, even if no functionality is added.

@lee-chase
Copy link
Member

Started to do this and decided it was not very Vue. Instead added the ability to use v-model with the table.

<cv-data-table
. . .
  v-model="rowSelects"
. . .
</cv-data-table>

<script>
. . .
data() {
  // rowSelects contains values of rows selected.
  return { rowSelects: [] }; 
}

methods: {
  onMyBatchClick() {
    // do stuff
    this.rowSelects = []; // or slice specific row values.
  }
}
</script>

Let me know if this works for you.

@lee-chase
Copy link
Member

Using v1.0.2 https://codepen.io/lee-chase/pen/YgVoXR

@lee-chase
Copy link
Member

It would appear that the table requires Vue version 2.6.1 as a minimum possible due to vuejs/vue#9330 as nothing else looks like it would impact on this issue 2.6.0 - 2.6.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants