Hi,
I want to remove the Save button in my tasklist.
In another thread I read about removing the button by its id:
Camunda Forum - Remove ‘Complete’ & ‘Save’ button
There its suggested to remove the save button by id via the angular api.
Could someone please give me some code example for this?
I have some problems finding the corrent id of the save button and I am not sure how to deactivate it after I found the right id.
Thanks in advance
Hi @MarvinKern,
The following HTML defines an embedded form. I use the life-cycle of the form to execute a custom script, which removes the save button:
<form role="form" name="form">
<script cam-script type="text/form-script">
camForm.on('form-loaded', function() {
let buttons = document.getElementsByClassName("btn btn-default ng-binding");
for (let i = 0; i < buttons.length; i++) {
if (buttons[i].getAttribute("ng-click") === 'save($event)') {
buttons[i].remove();
}
}
});
</script>
<label for="customerId">Customer Id:</label>
<input type="text" id="customerId"
cam-variable-name="CUSTOMER_ID"
cam-variable-type="String">
<label for="customerRevenue">Customer Revenue:</label>
<input type="text" id="customerRevenue"
cam-variable-name="CUSTOMER_REVENUE"
cam-variable-type="Double">
</form>
2 Likes
@StephanHaarmann Thanks a lot for your quick answer and the help.
In the meantime I also found a quick solution for my problem:
<script cam-script type="text/form-script">
$scope.options.hideCompleteButton = true;
</script>
You can just add this script in your static html file somewhere and it will remove the complete and save button.
2 Likes