How to use vuelidate in input fields in a table ?
See original GitHub issueHere I have a table where I am Showing data in tabular format and each column has input fields that can be edited. Then how can I check if a particular row is not empty or valid? I am using the bootstrap-vue table. Any help is highly appreciated.
Below is the code and its code pen is - https://codepen.io/kkdas202/pen/BaKjmZX?editors=1010
<b-table
small
:fields="fields"
:items="ItemList"
responsive="sm"
>
<template v-slot:cell(name)="data">
<b-form-group>
<b-input
:id="`name-${data.index}`"
placeholder="Enter name"
v-model="data.item.name"
></b-input>
</b-form-group>
</template>
<template v-slot:cell(email)="data">
<b-form-group>
<b-input
:id="`email-${data.index}`"
placeholder="Enter email"
v-model="data.item.email"
></b-input>
</b-form-group>
</template>
</b-table>
Fields:
fields: [ { key: 'name', label: 'Name' }, { key: 'email', label: 'Email' }],
items: [ { name:'John', email: 'abc@gmail.com'}, { name: 'Jane', email: 'xyz@gmail.com' }]
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top Results From Across the Web
How to use Vuelidate with editable Vuetify Data Table field
Render one dialog on the page and keep track of which row the user is editing in a data property. This property is...
Read more >Vuelidate | A Vue.js model validation library
Simple, lightweight model-based validation for Vue.js.
Read more >[Part 5] Validate Table Rows and Fields with Bootstrap Vue
Learn how to validate table rows and input fields with BootstrapVue and HTML form validation.
Read more >Form Validation With Vuelidate in Vue.js
In this post, you'll use a third-party library named Vuelidate to perform model validation depending on a particular rule set.
Read more >How to use Vuelidate with editable Vuetify Data Table field- ...
[Solved]-How to use Vuelidate with editable Vuetify Data Table field-Vue.js ... You don't want to render a dialog for each row in your...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@shentao Do you mean collection validation is going away? I have a similar use case, but a little more complicated. We’re using Vuex to load a list, and each row in the table is editable. I tried following the docs for collections, but am coming up short.
Here’s the code:
I can get the validation to trigger, but the error messages show up on every row, not just the one failing validation. Any thoughts are appreciated 🙏
Nope. Working with Node.js mostly. Why the question?