on ‎2021 Mar 19 3:58 PM
Hi Experts,
I need to highlight a few of the table's cell border colors on the basis of a condition and pre-fill it with some negative value.
View.xml
<t:Column width="100px">
<Label text="ActualQty"/>
<t:template>
<Input id="idInput" value="{ parts: [ {path: 'viewData>ACT_QTY'}, {path: 'viewData>MTART'} ], formatter: '._formatter.defaultInput' }">
<customData>
<core:CustomData key="colorclass" value="{path: 'viewData>MTART', formatter: '._formatter.formatCell'}" writeToDom="true"/>
</customData>
</Input>
</t:template>
</t:Column>
Formatter.js
formatCell: function (iValue) {
try {
iValue.toString();
} catch (err) {
iValue = "foo";
}
return iValue.toString();
},
defaultInput: function (iValue, iValue1) {
if (iValue !== 0 && iValue1 === "HALB") {
iValue = "-1";
return iValue;
} else {
return iValue;
}
}
style.css
div[data-colorclass="HALB"] {
border: 4px solid #fdf6b1 !important;
}
Highlighting and the default value is appearing. But inside the controller, The input value is not coming.

if I remove parts and pass single input param to formatter function, its working. But I need both the values to built my logic.
Request clarification before answering.
Now I understood, the formatter function will make it one-way binding. The link has a solution using custom type to make it two-way binding. But I am not able to create the Type for my case. Please guide.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
once you use formatter, it is oneway binding, means model--->UI, your input change in ui won't come to model.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 12 | |
| 9 | |
| 7 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.