Editor 1.4 dependent - shouldn't it fire if the modal is opened for edit ?
Editor 1.4 dependent - shouldn't it fire if the modal is opened for edit ?
e.g location shouldn't be displayed on edit either - if its a VP
editor.dependent( 'position', function ( val, data, callback ) {
return val === 'VP' ?
{ hide: 'location' } :
{ show: 'location' };
} );
Did try
{event: 'change initEdit'}
but i think it just listen for events of the field ...
This discussion has been closed.
Answers
Hi,
Yes, that should work. I'm unfortunately away from my main machine at the moment (back tomorrow) so I can't test this just now (unless you are able to link to a test page?), but I will do so tomorrow and let you know how I get on.
Allan
Sorry no Test Page ;) internal Testing - couldn't it get to work
just get output on change, or when the select list is updated ...
Hi,
Sorry for the delay in looking into this! I've just tried it locally and it does appear to work as expected. Using this example run the following on your console:
If a row with London is selected for editing, the phone input field is hidden. Otherwise it is shown.
One thing I notice - your dependency is on
bwrb_rel.id
which I guess is an integer? But you are testing against a string?Allan
I found the issue:
seems it doesn't work with select2 fields ... for any kind of modal it just works on a "change" event ...
I think the select2 plug-in will need a little update to correctly handle this. I'll post back here when I've done so.
Allan
any progress onthe issue?
Yes - sorry for the delay! I've just updated the plug-in. With that code the dependent method should work as expected (it does in my testing).
Allan