Closed miladhashemi closed 7 years ago
Can you show your code? Thanks
use dosamigos\grid\GridView; use dosamigos\grid\behaviors\GroupColumnsBehavior;
<?= GridView::widget([ 'behaviors' => [ [ 'class' => 'GroupColumnsBehavior', // You an use multiple columns for extra row but remember that will affect the merging // as both columns must be having same values for the extra row to title the records 'extraRowColumns' => ['category'], // you can use multiple columns here 'mergeColumns' => ['category'] ] ], 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [ ['class' => 'yii\grid\SerialColumn'], 'group_name', 'description', 'category', ['class' => 'yii\grid\ActionColumn'], ], ]); ?>
You forgot to add the namespace to the class
i'm new to Yii. the grid view is in view. is it necessary to use namespace? I add namespace but the result is same.
@miladhashemi you forgot to add the namespace of the class:
<?= GridView::widget([ 'behaviors' => [ [ 'class' => 'dosamigos\grid\behaviors\GroupColumnsBehavior' // <-------- here
If you don't want to do that... then do 'class' => GroupColumnsBehavior::class
I found the same error the above did not solve my problem any other solution?
Hi 2amigos when in behaviors i use GroupColumnsBehavior as class it shows me: ReflectionException
Class GroupColumnsBehavior does not exist