<v-toolbar flat>
<v-toolbar-title>Details</v-toolbar-title>
<div style="width:100%">
<v-col class="text-right">
<v-btn id="btnCopy" @click="Redirect()" class="black--text">COPY</v-btn>
</v-col>
</div>
<v-spacer></v-spacer>
</v-toolbar>
<v-data-table
v-model="selected"
:value="selected"
@input="enterSelect($event)"
:headers="headers"
:items="plist"
:single-select="singleSelect"
item-key="revId"
show-select
class="elevation-1"
:single-expand="singleExpand"
:expanded.sync="expanded"
show-expand
:items-per-page.sync="itemsPerPage"
:page.sync="page"
:loading="loadTable"
loading-text="Loading data....Please wait"
>
//dynamically adding onclick event for the selected checkbox row in v-data-table grid //in the below function values get all the values from the selected grid row but how to add parameter to the button?
without parameter im able to call button event but with parameter its not working?
enterSelect(values) {
var names = values.map( function(value) {
var copyButton = document.getElementById('btnCopy');
copyButton.setAttribute('onclick', 'Redirect');
})
}
// this is the actual function called when clicked on btnCopy
Redirect(revId) {
alert("Hello"+this.value.revId);
}
}
above is the part where a dynamic behavior is implemented in the v-data-table, such as selecting rows and triggering events using a button. The challenge lies in passing parameters to the button's click event handler function.