Seems you are trying to make relation manager field
disable(read only)
But I am sure they are not following same patter as normal widgets do
.
they can not be disabled directly like that as I found other easy way .
you may have used partial for rendering this relational field
( book | user ) and your partial _books.htm
is looking like this.
<?= $this->relationRender('comments', ['readOnly' => false]) ?>
You need to change it with this one
<?php if($this->widget->form->context == 'update'): ?>
<?= $this->relationRender('comments', ['readOnly' => true]) ?>
<?php else: ?>
<?= $this->relationRender('comments', ['readOnly' => false]) ?>
<?php endif; ?>
The magic config value is this readOnly
property it will make list read-only or active working
.
try this it will work , if not please comment.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.