Skip to content
Advertisement

How to create grid in yii with custom array?

I have created an array in php.

JavaScript

I will have dynamic columns like ip_addr, Management_col-2, ….and so on with there respective dynamic values.

I want to use it in Grid view of YII.

JavaScript

I also want to use filter on the table.

Plz help me for this.

Thank you so much in advance.

Advertisement

Answer

You can use CArrayDataProvider this a sample

Controller

JavaScript

View (gridview)

JavaScript

And buildin the column dinamically

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement