I'm showing a modal using "createElementSelectorModal()"
In some cases I need to pass ids of elements which should be selected right after the modal is created. Is it possible?
I'm showing a modal using "createElementSelectorModal()"
In some cases I need to pass ids of elements which should be selected right after the modal is created. Is it possible?
If I'm interpreting 'craft.js' correctly, there doesn't seem to be any way to do this, at least not via craft methods. Apart from passing in the initial settings parameter, everything else looks like protected methods.
You could potentially do it manually through javascript however by triggering a 'click' event on the elements directly. You would have to wait until the elements are loaded first however.
$('.elements tr[data-id="2201"]').trigger('click');