Hi Rodrigo,
Based on your query,
you want to send string parameters to the click event of the button in a
template column. We have achieved your requirement using the below method.
Please refer the below
code example:
|
<script id="OrderIDTemplate"
type="text/x-template">
<button class="btn btn-sm btn-success" onclick="WorkingFunction(${ OrderID
});" >${OrderID}</button>
</script>
<script id="CustomerIDTemplate" type="text/x-template">
<button class="btn btn-sm btn-warning" onclick="NotWorkingFunction(${getArgs(CustomerID)});">${CustomerID}</button>
</script>
<script type="text/javascript"
>
function WorkingFunction(id) {
alert(id);
}
function getArgs(args) {
return JSON.stringify(args);
}
function NotWorkingFunction(id) {
alert(id);
}
</script>
|
If this post is helpful, please
consider Accepting it as the solution so that other members can locate it more
quickly.