vue2-datatable-component ajax operations

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



vue2-datatable-component ajax operations





I am fairly new to Vue JS but have been using JavaScript for quite a while now. I have the vue2-datatable-component by onewaytech installed and have been using the Advanced Example that they have posted. The table is working correctly but am trying to have the buttons in the operations column execute an ajax call to delete the object displayed in that row. I didn't see anything in the documentation about passing the unique ID to the td-Opt so I am stuck.




1 Answer
1



you will have to use a dynamic component to make it. for example:


data ()
return
props: ['row'],
supportBackup: true,
supportNested: true,
tblClass: 'table-bordered',
tblStyle: 'color: #666',
pageSizeOptions: [5, 10, 15, 20],
columns: [
title: '#', field: 'uid', sortable: true,
title: 'Date', field: 'date_at', sortable: true,
title: 'Nombre', field: 'name', sortable: true,
title: 'Precio', field: 'total_price', sortable: true,
title: 'Action', field: 'action', tdComp: 'Opt',
],
data: ,
total: 0,
selection: ,
query: ,
`enter code here`
,



Where Opt:


import actionItem from "../xxx.vue";
import DisplayRow from "../Utils/nested-DisplayRow.vue";


components: "Opt": actionItem, , 'DisplayRow': DisplayRow,



So... in your ActionItem component you can create your component... that component will be your row action






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard