Create new function button in DV
Posted: 2025-02-19 11:18
Hello,
I'm trying to add a custom button in a table's DV so i created a file "hooks\mytable-dv.js" (where "mytable" is the table's name that I need to manage with the custom button):
but the button does not appears.
What's wrong ?
ALex.
I'm trying to add a custom button in a table's DV so i created a file "hooks\mytable-dv.js" (where "mytable" is the table's name that I need to manage with the custom button):
Code: Select all
jQuery(function() {
jQuery(".detail_view").ready(function() {
// Create the new button
var myButton = jQuery('<button class="btn btn-primary" id="customButton">Click here</button>');
// Add the button in the detailed view
jQuery(".detail_view h3").after(myButton);
// Define the button function
jQuery("#customButton").click(function() {
alert("Button clicked!");
});
});
});
What's wrong ?

ALex.