On my index page I have a button to ‘create’ a new sale model.
<?= Html::button('New Sale', ['value' => Url::to('index.php?r=sale/create'), 'class' => 'btn btn-primary', 'id' => 'modalButton']) ?>
The modal div code
Modal::begin([ 'header' => '<h4>New Sale</h4>', 'id' => 'modalCreateSale', 'size' => 'modal-lg', ]); echo "<div id='modalContent'></div>"; Modal::end();
I would like to do the same for the (kartik) gridview Edit button that is on the same page.
Can anyone suggest how I can have a second modal that opens the same form in another modal dialog ?
So firstly, how is that done using the "pen" icon in the gridview action column - where the create button above uses the Url::to, how can the same be done in the action column button.
And then, should it be the same modal div above, or do i create a second modal div for the edit version of the form ?
Hope that makes sense.