setting editor default value depending on mode
setting editor default value depending on mode
i have an editor form where i want to set the def value of a field to true on create, but false on edit.
the only way i can find to do this is use editor.add() on preOpen() - check the mode and add the field and its mode dependent value here.
seems a bit clunky, and as i have several fields like this I wondered if i can just set the default value depending on editor mode ?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
If you create a row and it sets the field to
true
, then edit it, the default won't apply (since it already has a value -true
). ThepreEdit
event is the way to do it with a call tofield().set()
and have it set the field to false.Allan
sorry, didn't explain too well.
i am referring to a checkbox which is unbound (ie has no field associated with it), so there is no field value to retrieve
however, the preEdit event looks like the kind of thing I need