Home » Tips » How to create dropdown in yii2 gridview

Today we are going to learn how to create dropdown in yii2 gridview. In this post, I will show you how we can add dropdown list in grid view filter and in the column value.

Let’s start.

In the above example, I create a dropdown for the status column. The resultant images are below:

dropdown image

(dropdown in yii2 gridview)


image for filter

gridiew filter dropdown

(dropdown in gridiew filter)

you can update status with the help of changeStatus() function.

Hope this will help you 🙂

how we can use dynamic model yii2
Meaning of tilde (~) caret (^) wildcard ( * ) in composer.json file

Back to top