Closed chrisschd closed 5 years ago
Hello, same here( Have you found any solutions?
I am not sure if this the same thing I had a problem.
I am using grid tab-x with multiple grid view and resolve the issue with filter by using Pjax settings with kartik GridView
use kartik\grid\GridView;
$customerContactsOverview= GridView::widget([
'dataProvider' => $dataContactsProvider,
'filterModel'=>$searchContactsModel,
'autoXlFormat'=>true,
'pjax'=>true,
'pjaxSettings'=>[
'neverTimeout'=>true,
'refreshGrid' => true,
],
'export'=>[
'fontAwesome'=>true,
'showConfirmAlert'=>false,
'target'=>GridView::TARGET_BLANK
],
For me don't work :( any solution ?
I am using the following and it works.
Have you updated to latest version?
Are you using separate data and filter providers?
'dataProvider' => $dataContactsProvider,
'filterModel'=>$searchContactsModel,
I am using kartik this
use kartik\grid\GridView;
use kartik\tabs\TabsX;
echo TabsX::widget([
'position' => TabsX::POS_ABOVE,
'align' => TabsX::ALIGN_LEFT,
'encodeLabels'=>false,
'enableStickyTabs' => true,
'stickyTabsOptions' => [
// 'selectorAttribute' => "data-target",
//'backToTop' => true,
],
'items' => [
[
'label'=>'<i class="glyphicon glyphicon-home"></i> Details',
'content' => $customerOverview,
],
[
'label'=>'<i class="glyphicon glyphicon-list-alt"></i> Tickets',
'content' => $ticketsOverview,
],
[
'label'=>'<i class="glyphicon glyphicon-list-alt"></i> Projects',
'content' => $projectsOverview,
],
[
'label'=>'<i class="glyphicon glyphicon-list-alt"></i> Contacts',
'content' => $customerContactsOverview,
],
[
'label'=>'<i class="glyphicon glyphicon-list-alt"></i> Users',
'content' => $assignedUsers,
],
],
]);
$customerContactsOverview= GridView::widget([
'dataProvider' => $dataContactsProvider,
'filterModel'=>$searchContactsModel,
'autoXlFormat'=>true,
'pjax'=>true,
'pjaxSettings'=>[
'neverTimeout'=>true,
'refreshGrid' => true,
],
'export'=>[
'fontAwesome'=>true,
'showConfirmAlert'=>false,
'target'=>GridView::TARGET_BLANK
],
'columns' => [
[
'class' => '\kartik\grid\SerialColumn',
],
[
'attribute' => 'contact_id',
'format' => 'raw',
'value'=>function ($model, $key, $index, $widget) {
return Html::a($model->contact_id, ['customers-contacts/view','id' => $model->contact_id], [
'title'=>'View Contact detail',
]);
},
],
'contact_name',
'contact_email',
'contact_tel',
[
'attribute' => 'contact_type',
'value' => function ($model){
$types=null;
if(isset($model->contact_type) and !empty($model->contact_type)){
$model['contact_type'] = str_split($model->contact_type,1);
foreach($model->contact_type as $type){
if(isset(Yii::$app->params['contacttypes'][$type])){
$types = $types.Yii::$app->params['contacttypes'][$type]." ";
}
}
return $types;
}
},
'filterType'=>GridView::FILTER_SELECT2,
'filterWidgetOptions'=>[
'theme' => 'krajee',
'options' => ['placeholder' => 'Type ...'],
'data' => Yii::$app->params['contacttypes'],
'pluginOptions'=>[
'allowClear' => true,
],
],
],
],//columns
'panel' => [
'heading'=>'<h3 class="panel-title"><i class="glyphicon glyphicon-list"></i> Customer Contacts</h3>',
'type'=>'info',
],
'toolbar' => [
[
'content'=>
Html::a('<i class="glyphicon glyphicon-plus"></i>',['customers-contacts/create'], [
'type'=>'button',
'title'=>'Create New Ticket',
'class'=>'btn btn-success',
'action' => 'create',
]),
],
'{export}',
'{toggleData}'
],
'responsive'=>true,
'hover'=>true,
]);
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hello,
I’ve a problem with tabx and gridview, follow scenario:
Tabx:
In view file view/user/details.php and controller UserController.php
Item “Customer” and “Products” has both the GridView in use. The first page of the GridView of the “Customer” and “Product” items is ok but if I click on the second page button or enter some filter/search text it fails. The view view/user/details.php will exit, the browser load (on click of the GridView “Customer”) the text values from the UserController.php/actionCustomerlist which is a Json:encoded output (echo Json::encode($html);)
Some Code Fragments:
The ActionCustomerlist
The _usercustomer.php
The _userproduct.php
The grid view has also an ID.
Where is my mistake? Thanks for help.