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条回答 默认 最新

  • dongyudun6465 2013-12-19 00:43
    关注

    The line EQuickDlgs::render('create',array('model'=>$model)); should be outside the scope of if.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 win10权限管理,限制普通用户使用删除功能
  • ¥15 minnio内存占用过大,内存没被回收(Windows环境)
  • ¥65 抖音咸鱼付款链接转码支付宝
  • ¥15 ubuntu22.04上安装ursim-3.15.8.106339遇到的问题
  • ¥15 求螺旋焊缝的图像处理
  • ¥15 blast算法(相关搜索:数据库)
  • ¥15 请问有人会紧聚焦相关的matlab知识嘛?
  • ¥15 网络通信安全解决方案
  • ¥50 yalmip+Gurobi
  • ¥20 win10修改放大文本以及缩放与布局后蓝屏无法正常进入桌面