Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'cjuidialog'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Single Editions
    • Modern Javascript: Develop and Design
    • The Yii Book
    • Effortless Flex 4 Development
    • Building a Web Site with Ajax: Visual QuickProject
    • Ruby: Visual QuickStart Guide
    • C++ Programming: Visual QuickStart Guide
    • C Programming: Visual QuickStart Guide
    • Adobe AIR: Visual QuickPro Guide
  • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
    • PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (2nd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (1st Edition)
  • PHP for the Web: Visual QuickStart Guide
    • PHP for the Web: Visual QuickStart Guide (5th Edition)
    • PHP for the Web: Visual QuickStart Guide (4th Edition)
    • PHP for the Web: Visual QuickStart Guide (3rd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (2nd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (1st Edition)
  • Effortless E-commerce with PHP and MySQL
    • Effortless E-Commerce with PHP and MySQL (2nd Edition)
    • Effortless E-Commerce with PHP and MySQL
  • PHP Advanced: Visual QuickPro Guide
    • PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (3rd Edition)
    • PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
    • PHP Advanced: Visual QuickPro Guide
  • MySQL: Visual QuickStart Guide
    • MySQL: Visual QuickStart Guide (2nd Edition)
    • MySQL: Visual QuickStart Guide (1st Edition)
  • Other
    • Announcements
    • Newsletter, Blog, and Other Topics
    • Forum Issues
    • Social

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 1 result

  1. I want to render a Model view completely in the CJuiDialog box. in actionIndex() i have pagination only for three records on the page public function actionIndex() { $dataProvider=new CActiveDataProvider('Jobs',array( 'pagination'=>array( 'pageSize'=>3, ),)); $this->render('index',array( 'dataProvider'=>$dataProvider, )); } the view of first three records display on the CJuiDialog as apopup. up to this working fine. the problem is when i click on next page of pagination then it renders all view of the next records on the index page with the list view. code is- actionView() public function actionView($id) {if (Yii::app()->request->isAjaxRequest) { //outputProcessing = true because including css-files ... $this->renderPartial('view', array( 'model'=>$this->loadModel($id), ),false,true); //js-code to open the dialog if (!empty($_GET['asDialog'])) echo CHtml::script('$("#dlg-address-view").dialog("open")'); Yii::app()->end(); } else $this->render('view',array( 'model'=>$this->loadModel($id), )); } index.php <?php $this->breadcrumbs=array( 'Jobs', ); $this->menu=array( array('label'=>'Create Jobs','url'=>array('create')), array('label'=>'Manage Jobs','url'=>array('admin')), ); ?> <h1>Jobs</h1> <?php $this->widget('bootstrap.widgets.TbListView',array( 'dataProvider'=>$dataProvider, 'itemView'=>'_view', )); ?> _view.php <?php $target = 'window.location='."'".$this->createUrl('jobs/index')."'"; $dialogId = "dialog_{$data->job_id}"; $this->beginWidget('zii.widgets.jui.CJuiDialog', array( 'id'=>$dialogId, // additional javascript options for the dialog plugin 'options'=>array( 'title'=>$data->job_title, 'autoOpen'=>false, 'show'=>array( 'effect'=>'blind', 'duration'=>1000, ), 'hide'=>array( 'effect'=>'explode', 'duration'=>500, ), 'buttons' => array( array('text'=>'Route','click'=> 'js:function(){'.$target.'}'), array('text'=>'Cancel','click'=> 'js:function(){$(this).dialog("close");}'), ), 'height'=>500, 'width'=>450, 'show'=>'fade', 'hide'=>'fade', ), )); $this->renderPartial('/jobs/view',array('model'=>$data)); $this->endWidget('zii.widgets.jui.CJuiDialog'); // the link that may open the dialog echo CHtml::link(CHtml::encode($data->job_id), '#', array( 'onclick'=>'$("#'. $dialogId .'").dialog("open"); return false;', )); ?> view.php <?php $this->widget('bootstrap.widgets.TbDetailView',array( 'data'=>$model, 'attributes'=>array( array( 'name'=>'job_id', // only admin user can see person id 'visible'=>Yii::app()->user->name=='admin'? true : false, ), array('name'=>'job_code','label'=>'Job Code'), array('name'=>'job_title','label'=>'Title'), array('name'=>'job_desc','label'=>'Description'), array('name'=>'job_lastdate','label'=>'Last Date'), 'job_photo', 'job_file', array( //'label'=>'Ad Photo', 'type'=>'raw', 'value'=>CHtml::tag('img', array("title"=>$model->job_photo, "src"=>Yii::app()->baseUrl."/images/".$model->job_photo, "style"=>"width:400px") ) ), //'job_createtime', ), )); ?> what is wrong in my code? i am not getting anything. i just think the problem is that of ajax request. because going to next page in the pagination is ajax request and because of this pagination the view of record (view.php) is partially rendered on the listview of index.php but what will be the solution to avoid this?? help me please Thank you.
×
×
  • Create New...