]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Удаление
authorVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Fri, 5 Sep 2025 15:31:14 +0000 (18:31 +0300)
committerVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Fri, 5 Sep 2025 15:31:14 +0000 (18:31 +0300)
erp24/records/MatrixTypeSearch.php
erp24/views/matrix-type/index.php

index d235f8fb3144fae629bf3253f718fac14a430c28..0aaffb53136af0701ed88a8587642617d77a4d4e 100644 (file)
@@ -52,6 +52,7 @@ class MatrixTypeSearch extends MatrixType
             'allModels' => $filtered,
             'pagination' => false,
             'sort' => false,
+            'key' => 'id',
         ]);
     }
 }
\ No newline at end of file
index cbfd577b5fdc5618ee3eb858187f822764cc72fd..dd9e95c0a83e2787f35f262716ac7068fd86a4ac 100644 (file)
@@ -192,6 +192,12 @@ $this->registerJsFile('/js/matrix-type/index.js', ['position' => \yii\web\View::
             ['class' => 'yii\grid\ActionColumn',
                 'template' => '{delete}',
                 'contentOptions' => ['class' => 'text-center', 'style' => 'width:80px;  min-width:50px;  '],
+                'urlCreator' => function ($action, $model, $key, $index) {
+                    if ($action === 'delete') {
+                        return Url::to(['delete', 'id' => $model->id]);
+                    }
+                    return '#';
+                },
                 'buttons' => [
                     'delete' => function ($url, $model, $key)
                     {