dragon456101
2013-12-18 13:14
浏览 31
已采纳

Yii使用quickdlgs在CGrid视图中创建新记录

In my web application I need to create an iframe button using quickdlgs for creating new records. But when I click the I frame button I am not getting the 'create' web page but I am getting an empty Iframe. My actionCreate code for the controller

public function actionCreate()
    {
    $model=new Store;
        // Uncomment the following line if AJAX validation is needed
        // $this->performAjaxValidation($model);
        if(isset($_POST['Store']))
        {
            $model->attributes=$_POST['Store'];
            if($model->save())
            {
              EQuickDlgs::checkDialogJsScript();
             $this->redirect(array('admin'));
             }
             $this->redirect(array('view','id'=>$model->id));
               EQuickDlgs::render('create',array('model'=>$model));
            //  $this->redirect(array('create'));

}
}

My view code for the iframe

<?php
EQuickDlgs::iframeButton(
    array(
         //'id' =>'create',
        //  'renderOpenButton' => false,
        'controllerRoute' => 'create',
       //'url'   =>'/store/create',
        'dialogTitle' => 'Create Store',
        'dialogWidth' => 500,
        'dialogHeight' => 500,
        'openButtonText' => 'Create new',
        'closeButtonText' => 'Close',
        //'closeOnAction' => true, //important to invoke the close action in the actionCreate
        'refreshGridId' => 'store-grid', //the grid with this id will be refreshed after closing
    )
);
?>

This code I have written in the admin.php view page. But when I click the iframe button I am getting an empty iframe instead of the create button. Any body kindly help me with this.

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题