Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Yii2 Extended/Customize GridView

I need to develop Yii2 customized GridView to achieve below output:

enter image description here

Left most column (First column) displays headers. Right hand side columns are editable. It's something like row in normal GridView. Adding new entry, add new column to end of right side (Green colour). Important thing is all columns cells editable apart from first column.

It's just like normal Yii2 GridView orientation changes to landscape from portrait.

Can I achieve this using Yii2 GridView or ListView? If so please pointing me to right direction.

Otherwise any custom implementation of Yii2 GridView to achieve same; something like Kartik - Krajee - GridView

like image 276
Yohan Hirimuthugoda Avatar asked May 15 '16 18:05

Yohan Hirimuthugoda


Video Answer


1 Answers

As I imagine, you need something like MS Excel table but in web, so I suggest you to try Handsontable. Take a look at example that I took from repository.

Left most column (First column) displays headers. Important thing is all columns cells editable apart from first column.

Note, that all Handsontable cells are editable by default, so in order to make first column not editable you set {editable: false} in columns array for the first column.

Adding new entry, add new column to end of right side (Green colour).

In this example you can see that "K" column is empty. If you fill one of "K" column cell, the new column "L" will be created next to the column "K".

like image 154
Kamaronas Avatar answered Oct 30 '22 21:10

Kamaronas