Answer the question
In order to leave comments, you need to log in
Is it possible to make TabsX Kartik tabs inactive?
Hello everyone,
I'm new and just trying to figure out YII2, I have a question. I have three tabs in each of them is a DetailView, is it possible to make it so that if there is no data in one of the DetailViews, then the tab gets another css class?
echo TabsX::widget([
'position' => TabsX::POS_ABOVE,
'align' => TabsX::ALIGN_LEFT,
'items' => [
[
'label' => '<i class="glyphicon glyphicon-list"></i> Вкладка 1',
'content' => DetailView::widget([
'id'=>'info1',
'model' => $model,
'panel' => [
'heading' => '<h3 class="panel-title">'.$model->Name.'</h3>',
'type'=>DetailView::TYPE_SUCCESS,
],
'attributes' => $info_one,
]),
'encode'=>false,
'active' => true
],
[
'label' => '<i class="glyphicon glyphicon-ok"></i> Вкладка 2',
'content' => DetailView::widget([
'id'=>'info1',
'model' => $model,
'panel' => [
'heading' => '<h3 class="panel-title">'.$model->Name.'</h3>',
'type'=>DetailView::TYPE_SUCCESS,
],
'attributes' => $info_two,
]),
'encode'=>false,
],
[
'label' => '<i class="glyphicon glyphicon-briefcase"></i> Вкладка 3',
'content' => DetailView::widget([
'id'=>'info1',
'model' => $model,
'panel' => [
'heading' => '<h3 class="panel-title">'.$model->Name.'</h3>',
'type'=>DetailView::TYPE_SUCCESS,
],
'attributes' => $info_three,
]),
'encode'=>false,
],
]
]);
Answer the question
In order to leave comments, you need to log in
[
'label' => '<i class="glyphicon glyphicon-briefcase"></i> Вкладка 3',
'content' => DetailView::widget([
'id'=>'info1',
'model' => $model,
'panel' => [
'heading' => '<h3 class="panel-title">'.$model->Name.'</h3>',
'type'=>DetailView::TYPE_SUCCESS,
],
'attributes' => $info_three,
]),
'encode'=>false,
'headerOptions' => ['class'=> $value ? '' : 'disabled']
],
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question