How to change the value of a service response while mapping? For example, an array of telephone numbers is mapped to a grid.
I want to change the value of the telephone numbers dynamically, based upon the value that is being received.
How to change the value of a service response while mapping? For example, an array of telephone numbers is mapped to a grid.
I want to change the value of the telephone numbers dynamically, based upon the value that is being received.
Everything in the "edit js" section is working (the str variable is initialized before) according to the console.log that i did. It is just that value.CleanedValue doesn't get a new value, it just shows the initial value in the grid. It is like the statement "value.CleanedValue = xxx" doesn't change the actual value.CleanedValue
You can't change value.CleanedValue in mapping
"value" is a local variable.
If you need to set lblCommunicatieValue.text depending on DIASType_obj value then you can just set the value manually in JS (without mapping from CleanedValue to lblCommunicatieValue.text).
Change your JS in mapping:
precodeif (value.DIASType_obj == "15580.100001" ) {
$('[dsid=lblCommunicatieValue]', element).text("+" + str.pop());
} else { //you need this section because now there is no mapping from CleanedValue to lblCommunicatieValue.text
$('[dsid=lblCommunicatieValue]', element).text(value.CleanedValue);
}
/code/pre
If value is a local value, what is the "return value" statement for in the "edit js" sections?
Also, if you do "return 'xxx' " in the "edit js" section of lblCommunicatieValue, then the 'xxx' is shown in the label, how does that work then?
Returned value is used as new value for this particular component.