Tables Custom rendering
See original GitHub issueI am a totally newbie here.
In the Tables Custom rendering example, it says:
<template slot="name" scope="field">
{{field.name.first}} {{field.name.last}}
</template>
So, why in the example after “Custom rendering” section:
<template slot="actions" scope="item">
<b-btn size="sm" @click="details(item.item)">Details</b-btn>
</template>
shouldn’t the scope be “field” ?
And in fact, I have tried both (scope=“item” and scope=“field” ), but the button won’t show up in my page… I am totally lost… (but the custom rendering button seems to work on jsfiddle no problem…)
Here is snippet of my code:
<template>
<div>
<b-table striped bordered hover show-empty responsive :items="items" :fields="fields">
<template slot="wonumber" scope="item">
{{item.wonumber}}
</template>
<template slot="status" scope="item">
{{item.value.status}}
</template>
<template slot="actions" scope="field">
<b-btn variant="primary" @click="details(item.item)">Change Status</b-btn>
</template>-->
</b-table>
</div>
</template>
<script>
export default {
data() {
return {
items: [
{
wonumber: 'wonumber_001',
status: true
}, {
wonumber: 'wonumber_002',
status: true
}
],
fields: {
wonumber: {
label: 'WO Number'
},
status: {
label: 'Status'
},
actions: {
label: 'Actions'
}
}
}
},
methods: {
details(item) {
alert(JSON.stringify(item))
}
}
}
</script>
I am using the newest 0.16.1, everything else seem working properly, except the custom button won’t show up… Thank you in advance for any tips.
Issue Analytics
- State:
- Created 6 years ago
- Comments:20 (13 by maintainers)
Top Results From Across the Web
Custom Rendering • reactable - GitHub Pages
Custom Rendering ; Easier to use but more static; Render once, when the table is created; Supports htmltools and htmlwidgets. Harder to use...
Read more >4. Render Custom Component in Material Table || Material UI
Render Custom Component in Material Table || Material UIHey Guys, in this video we will see how to render custom component and do ......
Read more >Custom Dining Table Rendering
Custom Dining Table Rendering. Photo-2016-01-08-5-03-27-PM-2-3.jpg. Photo-2016-01-08-5-03-27-PM-. Custom Dining Table Rendering. Request a quote online.
Read more >TYPO3 - Custom Table Rendering - Electric Retina
The TYPO3 CMS is extremely powerful and infinitely configurable and customizable. These are great features in a CMS when your client asks ...
Read more >Custom table rendering — DataTables forums
Is it possible or smart to render data as pads or buttons - ie something other than a table using the editor /...
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 FreeTop 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
Top GitHub Comments
Hello @alexsasharegan I already have. Thank you.
Check out PR #433
I’ve added some clarity and improved example for scope slots. I know the documentation (and scoped slots) confused me a bit, so I’ve updated it to make usage more clear (using
item
orfield
as the scope variable can be confusing with theitems
andfields
data).@neildchen The
scope="variable"
creates a local template variable that contains the properties passed to the named slot. The variable will contain the properties:value
- the fields value (ornull
if a virtual column/field)item
- the entire item record objectindex
- the row number (zero based counter)