With reference to How to implement Yii2 Modal Dialog on Gridview view and update button?, the problem is currently solved on enabling Yii2 gridview view button with modal di
This happens because of this line:
$('.modal-body').html(data);
That means the html will be inserted into each modal body.
In case of multiple modals in one page you should specify exact modal which you want to change.
Change this line to:
$('#activity-modal').find('.modal-body').html(data);
Additionally you can clear modal's content using events:
$('#activity-modal').on('hidden.bs.modal', function (e) {
$(this).find('.modal-body').html('');
})
Check the events section in official Boostrap 3 documentation to modals.