'contentOptions' => ['style'=>'min-width:150px;'],
'value' => function ($row, $key, $index) {
$product = $row['product'];
- $name = Html::encode($product->name . ' (' . $product->id . ')');
-
- return '<div class="d-flex justify-content-between">' . $name . '</div>';
+ $name = Html::encode($product->name . ' (' . $product->guid . ')');
+ $anchor = Html::a($name, ['bouquet/view', 'id' => $product->id], ['target' => '_blank']);
+ return '<div class="d-flex justify-content-between">' . $anchor . '</div>';
}
],
[
'attribute' => 'price',
'label' => 'Цена',
- 'value' => function($row) { return $row['price']->price; },
+ 'value' => function($row) {
+ if ($row['price']) {
+ return $row['price']->price;
+ }
+ },
'format' => ['decimal', 2],
],
[
});
});
- // Мьютекс для чекбоксов "Только активные/неактивные" (необязательно, но удобно)
+
const onlyActive = document.getElementById('onlyActiveCheckbox');
const onlyInactive = document.getElementById('onlyInactiveCheckbox');
if (onlyActive && onlyInactive) {
group.addEventListener('change', filterSubgroups);
- // Первый проход (на случай когда значения уже выбраны в GET)
+
filterSubgroups();
})();
JS;