I know I could mock my own html table, but is it possible to pass an instance of vue-table as a child row ?
So that when you click the toggler it expands and shows multiple table rows associated with each row of the parent table?
I don't see why not. Add a property to each row which contains the data for the child table, and pass it as the data prop in the child row template.
Yep! I was just about to reply.. got it working after ~30m of trials.. and it's sooo awesome!!!!
@vesper8 I know this is old, but what did you do to accomplish this? If you're willing, a jsfiddle example would be aweseome.
Nevermind, figured it out.
Here's what I did:
Create a child component:
Vue.component('child-table', {
name: 'ChildRow',
props: ['data'],
template: '<v-client-table :data="childData" :columns="childColumns"></v-client-table>',
data: function () {
return {
childColumns: ['foo', 'bazz', 'bar'],
childData: [{
foo: 'Col1',
bazz: 'Col2',
bar: 'Col3'
}]
};
},
});
Create a parent table like normal. In the parent table, do:
data: { <yourcustomstuff> options: { <your custom options> childRow: 'child-table' } }
there you go :) glad you figured it out
Hi,
Very interested in this solution to implement childRow; but I struggle to pass key parameter, as each sub-table data are built from the parent key. How can I link childtable to key of childRow ?
Most helpful comment
Nevermind, figured it out.
Here's what I did:
Create a child component:
Create a parent table like normal. In the parent table, do:
data: { <yourcustomstuff> options: { <your custom options> childRow: 'child-table' } }