Questions tagged [yii2-grid]

21 questions
2
votes
0 answers

Add multiple Select2 Widget inside gridview column (Not as filter Column) in YII2

Hello I am trying to add a select2 widget inside gridview columns for each driver in Yii2. The grid is for driver model. One driver may have multiple zones. As in picture below: Here is the grid: I have created a relation in Driver…
Mohammad Hammadi
  • 733
  • 2
  • 11
  • 34
2
votes
1 answer

Yii2 data-* attributes not rendered using GridView Column

How do add data-id in below function: GridView::widget([ 'dataProvider' => $dataProvider, 'columns' => [ [ 'contentOptions' => ['class' => "text-center"], 'attribute' => 'scale', "format"=>"Html", …
2
votes
0 answers

Yii2 : Image not export to excel sheet in Kartik GridView

I have used the Yii2-grid and Yii2-dynagrid. when I go to export image column from grid view but image column not exported and it shows blank cell in excel sheet. Here my code. $model->p_image is live server image url like…
GAMITG
  • 3,810
  • 7
  • 32
  • 51
1
vote
0 answers

Yii2 Kartik ExpandRowColumn - concatenate string with action button/icon to expand

It's possible add code in action column to expand ExpandRowColumn like with anonymous function? I need add in this column total rows in each ExpandRowColumn like in in the following image. example in expandIcon property: [ 'class' =>…
Moutinho
  • 339
  • 8
  • 22
1
vote
1 answer

Yii2: How to show less lines on all rows of a Gridview?

I have a Gridview with three columns. The Query column is a PostgreSQL TEXT type and has 9 lines in this example. I would like to show only the first 4 lines for all rows else my table will be too big.
Roby Sottini
  • 2,117
  • 6
  • 48
  • 88
1
vote
1 answer

change combo filter into checkbox filter on yii2 grid view

i want to change the combo filter on yii2 gridview into multiple checkbox is it possible ? here is my gridview with combo filter $dataProvider2, 'filterModel' => $searchModel, 'columns' =>…
1
vote
1 answer

How to send model values in controller in Yii2

I have a view in which I have used GridView and DetailView. In my controller I am sending a model via it's ID. So in this way my GridView is working. Controller 1 public function actionViewcreated($id) { $model=$this->findModel($id);//the…
Moeez
  • 494
  • 9
  • 55
  • 147
1
vote
1 answer

Yii2 gridview pagination shows same values

I have the following code in modelsearch for gridview display of data. public function search($params ) { $tech=array(22,24,25,29); $query=(new \yii\db\Query())-> select(['tbl_ticket.*', 'tbl_assignment.ticket_id', …
user7282
  • 5,106
  • 9
  • 41
  • 72
1
vote
1 answer

Yii2: GridView Speed Optimization

I'm using Yii2 GridView to display data from ActiveDataProvider, the speed of it is working nicely when its pagination-enabled. But when displaying all the rows, everything lags. I'm using a normal Controller->View flow.
TechMafioso
  • 135
  • 4
  • 16
1
vote
1 answer

In Yii2 Unable to show custom column from model in gridview

Below is the dataprovider query i have used in search function of the UserSearch model, extended from User model. I am trying to show the value of 'entries' in the gridview but unable to access the column 'entries'. Please help. $query =…
Vivek Palanisamy
  • 148
  • 1
  • 10
1
vote
1 answer

yii2 connect tables in gridview

I have main table and several sub tables. Main table Product : productID / productNameID / productColorID and subtables productName : productNameID / name productColor : productColorID / name In main table I just insert IDs of sub tables. And to get…
David
  • 4,332
  • 13
  • 54
  • 93
0
votes
1 answer

Yii2 Gridview Sort By Caculated Field

I have customer table and need to show the customer's balance that need to calculate from another table. Now on Customer Model I have added Getter function public function getBalance(){ $customer_id = $this->id; $connection =…
Chhorn Soro
  • 3,061
  • 8
  • 27
  • 43
0
votes
1 answer

Yii 2 Gridview sorting header- add custom parameter in the url

When I click on the column header of Grid view, it is getting sorted, and in the URL sort parameter is gettting passed like page/index?id=12&sort=column1. I want to add another parameter while sorting like this…
Rahm
  • 3
  • 4
0
votes
0 answers

ExpandRowColumn is not expanded row in my DynaGrid

Yii: 2.0.16-dev "minimum-stability": "dev", "require": { "php": ">=5.4.0", "yiisoft/yii2": "~2.0.14", "yiisoft/yii2-bootstrap4": "@dev", "yiisoft/yii2-swiftmailer": "~2.0.0", "kartik-v/yii2-grid":…
Bharat Chauhan
  • 3,204
  • 5
  • 39
  • 52
0
votes
0 answers

Yii2 Gridview ID option

I have this code below which will generate list of patients. Gridview summary is accurate but my pagination won't work. If I add id option 'id' => 'patientsList',, it will display all the patient on each page. How should I fix this? What are the…
anon97
  • 15
  • 5
1
2