Hello,
Is there a way on how I can create a grid using CFormModel, just like setting the items inside the grid from a SQL statement and can be sortable by using WHERE keyword?
Page 1 of 1
Yii Grid Using Cformmodel Grid
#2
Posted 17 January 2013 - 08:28 AM
No, it's not I think. There are special classes which do exactly what you want.
Why do you want to do it this way
?
Why do you want to do it this way
#3
Posted 17 January 2013 - 08:43 AM
You can use CArrayDataProvider or CSqlDataProvider for your CGridView.
But IMHO you should not try them until you encounter a really complicated demand that you would find it difficult to handle with CActiveDataProvider. It's quite sure that they will require you a lot more coding than CActiveDataProvider.
But IMHO you should not try them until you encounter a really complicated demand that you would find it difficult to handle with CActiveDataProvider. It's quite sure that they will require you a lot more coding than CActiveDataProvider.
#4
Posted 17 January 2013 - 09:24 AM
Thank You guys,
I have searched CSqlProvider and apply it in a sample program but when I try it I received an erro saying:
PHP notice
Undefined index: id
/var/www/YiiProject2/yii/framework/web/CSqlDataProvider.php(119)
You can see my sample data here:
http://www.yiiframew...index-id-error/
Thanks again.
I have searched CSqlProvider and apply it in a sample program but when I try it I received an erro saying:
PHP notice
Undefined index: id
/var/www/YiiProject2/yii/framework/web/CSqlDataProvider.php(119)
You can see my sample data here:
http://www.yiiframew...index-id-error/
Thanks again.
Share this topic:
Page 1 of 1

Help













