diff --git a/crud/default/views/_expand.php b/crud/default/views/_expand.php
index e31a1a6..749256f 100644
--- a/crud/default/views/_expand.php
+++ b/crud/default/views/_expand.php
@@ -5,6 +5,8 @@
use yii\helpers\Inflector;
use yii\helpers\StringHelper;
+
+$pk = empty($generator->tableSchema->primaryKey) ? $generator->tableSchema->getColumnNames()[0] : $generator->tableSchema->primaryKey[0];
?>
= "
@@ -14,6 +16,7 @@
$items = [
[
'label' => ' '. Html::encode(= $generator->generateString(StringHelper::basename($generator->modelClass)) ?>),
+ 'options' => ['id' => "tab_= StringHelper::basename($generator->modelClass) ?>_{$model->= $pk ?>}"],
'content' => $this->render('_detail', [
'model' => $model,
]),
@@ -22,6 +25,7 @@
skippedRelations)): ?>
[
'label' => ' '. Html::encode(= $generator->generateString(Inflector::camel2words($rel[1])) ?>),
+ 'options' => ['id' => "tab_= $rel[1] ?>_{$model->= $pk ?>}"],
'content' => $this->render('_data= $rel[1] ?>', [
'model' => $model,
'row' => $model->= $name ?>,
@@ -30,6 +34,7 @@
[
'label' => ' '. Html::encode(= $generator->generateString(Inflector::camel2words($rel[1])) ?>),
+ 'options' => ['id' => "tab_= $rel[1] ?>_{$model->= $pk ?>}"],
'content' => $this->render('_data= $rel[1] ?>', [
'model' => $model->= $name ?>
]),