How to Disable Editor Dependent on Action Edit
How to Disable Editor Dependent on Action Edit
vincmeister
Posts: 136Questions: 36Answers: 4
in Editor
Hello Allan,
How to Disable Editor Dependent on Action Edit.
For example, i have 2 select fields, country and city.
I find this answer from you, but not help me much.
Is there any built in function to disable dependent on edit? Please advise, thank you
This discussion has been closed.
Answers
No - there isn't a built in method for that I'm afraid. I'm not clear on why you wouldn't want that relationship to apply during edit?
However, what you could do is:
which would disable the
dependent()
action (since all it really does is use an event listener itself).Allan
Because the city's field already selected on create process
when user edit the record, the select box back to the first option of the list
Please advise, thank you
Did you try the
$().off()
command I suggested above?Allan
Hi Allan,
I try this
but the city's field appear blank when editor open. Is that what you mean? Need more help, thank you
You asked how to remove the dependent action, and the above code should do that. I presume your
dependent()
action is on the Provinsi field? If so, that is the one you would run the$().off()
method on to remove its event listener.Allan
Yes
but when the form opened, the city's field change to 1st option of the list
That suggests that the actual value of the city isn't in the select list. Can you give me a link to the page showing the issue so I can check that please?
Allan
@vincmeister
replace ".input()" with ".node()". Then it should work if you've got the right field.
Just tried it myself.