Using preChange and postChange
Now it's time to cover preChange
and postChange
. These two functions will only be available in components whose main purpose is to be used as filters. Examples of this are select, input, date range, radio button, button, multi button, and so on.
Every component where we can set a parameter to store the selections and the lifecycle of the component will trigger fireChange
to that parameter. We have the option to specify the function that will be executed both before this happens and after applying the changes to the parameter, preChange
and postChange
. Take a look at following image:
As you can figure out, that the first function, the preChange
function, can be used to execute the code that can validate the options and take some actions before changing the parameter value. Can be used to prepare something before other components starts to execute because they are listening to that same parameter. The other postExecution function, can be used to perform operations...