Latha
(Lparameshwarappa)
July 8, 2013, 5:22am
1
Hi., i have joined 2 tables.,
tbl_one(id, name),
tbl_two(did,born),
i am displaying id, name and born in grid view.
but for born column., i am not getting text box to search., my code is.,
model names are tbl_one and tbl_two.
array(
'name' => 'table_two.born',
'value' => '$data->table_two->born',
'filter'=>CHtml::listData(tbl_two::model()->findAll(), 'born', 'born'),
still not getting textbox to search.,
plz., help me
softark
(Softark)
July 8, 2013, 5:48am
2
Latha
(Lparameshwarappa)
July 8, 2013, 6:14am
3
thanks…, its working now as i want…
hi…i am newbie …so i have some doubt…shall i ask…i already ask the everyone no one reply…
My question is …
i have two models how can i save data using one form view i saw more examples but i cant get any idea about that…so plz fellow the below link …i attached my model ,view file and attached table design so plz help me…
http://www.yiiframework.com/forum/index.php/topic/52109-save-data-with-two-models/
KonApaz:
Just I answered it!
Thanks bro…Thanks… now i reply that post so plz see that and answer my question boss…plz reply boss …
Jii wat ur reply i did like that but i have some error …
public function actionCreate()
{
$model=new TCategory;
$description =new TCategoryDescription;
//perform ajx validation
$this->performAjaxValidation($model,$description);
if(isset($_POST['TCategory']))
{
$model->attributes=$_POST['TCategory'];
$model->save();
}
if(isset($_POST['TCategoryDescription']))
{
$connection=yii::app()->db;
$sql="select * from t_category order by pk_i_id desc limit 1";
$command=$connection->createcommand($sql);
$row=$command->queryRow();
foreach($row as $r)
{
$fk_i_category_id=$row["pk_i_id"];
}
$description->fk_i_category_id=$fk_i_category_id;
$description->fk_c_locale_code='en_US';
$description->attributes=$_POST['TCategoryDescription'];
$description->save();
}
$this->render('create',array('model'=>$model,'description'=>$description));
}
primary key constraints error …how i get the last inserted record id of t_cateogy table primary key value and at the same time i inserted the value in t_cetegory_description table…how i do that plz help me …