Reputation: 1639
Is there a way to dynamically hide / show (display) a table row in a dynamic bootstrap-vue table?
I'm currently using the _rowVariant
prop to create a class on the row, which is working, but I'm having trouble figuring out how to additionally connect the show_old_projects
value to the row's display... since the rows are added dynamically.
<b-form-checkbox v-model="show_old_projects" value="true" unchecked-value="false">
Show old projects
</b-form-checkbox>
<b-table :fields="fields" :items="projects" :filter="filter"></table>
...
validateProjects() {
for (const project of this.projects){
if (project.end_date < this.date) {
project._rowVariant = 'muted';
}
}
}
...
.table-muted {
@extend .text-muted;
}
Any ideas?
Upvotes: 1
Views: 2706
Reputation: 1639
Here's what I ended up doing:
projects
and old_projects
old_projects
below the projects
tablev-show="show_old_projects"
to the old_projects
tableIf somebody can think of a cleaner way to do this I'm open to suggestions... otherwise this is working fine.
Upvotes: 1