or
I have this field in my kendo grid column :
field: "tauxAcquisEntree",
template: '#if (tauxAcquisEntree === 0){#'
+ '<div class="text-right">#= tauxAcquisEntree #</div>'
+ '# }else if (tauxAcquisEntree > 1 ){#'
+ '<div class="d-flex justify-content-end"><div class="input-group d-flex flex-nowrap percent-input"> <input id="fraisent" name="fraisent" value="#= tauxAcquisEntree #" max="4" class="form-control text-center" min="1" type="number" step=1 pattern="[0-9]$" autocomplete="off" /> </div></div>'
+ '# }else{#'
+ '<div id="fraisOne" name="fraisOne" class="d-flex justify-content-end"><div class="input-group d-flex flex-nowrap percent-input"> <input value="#= tauxAcquisEntree #" class="form-control text-center" max="1" min="1" type ="number" pattern="[0-1]$" autocomplete="off" readonly /> </div></div>'
+ '# }#'
,
I have a condition when i get the field "tauxAcquisEntree" from the "database" if it's equal to "1" the input type number becomes readonly.
The problem is when the user changes the value of the input type number in the front and it's equal to "1" the template condition gets triggered which is a behavior that i don't want to happen.
To summarize how can i get the if condition in the template to be applied only if the value if from backend or the database (and not what the user typed) ?