Viewer API menu: How to retain parameters prior to Apply or Cancel

We are working with a menu of parameters without customize(). Then, after a few changes we added a Apply button that calls for customize().
A) We would colour/mark parameters changed until apply button is clicked.
B) Then we would retain this parameters to put back on prior place if Cancel is clicked.
It woult be amazing some shortcut or example or any help for this features.
Thank you

This behaviour cannot be handled by the ShapeDiver API as it is specific to your application. You need to store the state of all parameters in the application and use this state to colour the “pending” parameters on the one hand and restore the UI controls to the stored value when clicking on cancel.