EJuiDateTimePicker/CJuiDateTimePicker not working inside a CJuiDialog - php

This seemed to be asked before but applying such answers did not gave me the solution. I have a create form which records the payments of the clients. It works just fine until I tried to transfer it inside a CJuiDialog in another view.
In my create.php:
<?php
/* #var $this PaymentsController */
/* #var $model Payments */
$this->breadcrumbs=array(
'Payments'=>array('index'),
'Create',
);
$this->menu=array(
array('label'=>'List Payments', 'url'=>array('index')),
array('label'=>'Manage Payments', 'url'=>array('admin')),
);
?>
<h4 class="text-success">Payments <span class="glyphicon glyphicon-tag"></span></h4>
<hr>
<?php $this->renderPartial('_form', array('model'=>$model)); ?>
And this is how i put the datetimepicker in my _form.php:
<div class="row">
<?php echo $form->labelEx($model,'payment_date'); ?>
<?php
$this->widget('EJuiDateTimePicker',array(
'model'=>$model, //Model object
'attribute'=>'payment_date', //attribute name
//'dateFormat'=>'dd-mm-yy',
'value'=>date('MM-dd-yy H:i:s'),
'mode'=>'datetime', //use "time","date" or "datetime" (default)
'language'=>'en-GB',
'options'=>array(
'dateFormat'=>'yy-mm-dd',
) // jquery plugin options
));
?>
<?php echo $form->error($model,'payment_date'); ?>
</div>
and in my actionCreate controller:
public function actionCreate($id, $bal)
{
$model=new Payments;
$model->contract_id = $id;
// Uncomment the following line if AJAX validation is needed
$this->performAjaxValidation($model);
if(isset($_POST['Payments']))
{
$_POST['Payments']['remaining_balance'] = $bal - $_POST['Payments']['down_payment'];
$_POST['Payments']['paid_thru'] = $_POST['Payments']['account_id'];
$balance = $_POST['Payments']['remaining_balance'];
$model->attributes=$_POST['Payments'];
if($model->save())
{
$model->updateBalance($id, $balance);
$this->redirect(array('servicecontract/view','id'=>$id));
}
}
$this->renderPartial('create',array(
'model'=>$model, 'contr'=>$id,
),false, true);
}
and this is how I implement the CJuiDialog in my view.php:
<?php
echo CHtml::ajaxLink(
"Make Payments", //link label
Yii::app()->createUrl( 'tcfunecareModule/payments/create'),
array( // ajaxOptions
'type' => 'GET',
'success' => "function( data )
{
//alert( data );
$('#mydialog').dialog('open');
$('#dlg-content').html(data);
}",
'data' => array( 'id' => $model->contract_id, 'bal'=>$model->contract_balance)
),
array('class'=>'btn btn-info pull-right')
);
?>
<?php $this->beginWidget('zii.widgets.jui.CJuiDialog', array(
'id' => "mydialog",
'options' => array(
'autoOpen' => false,
'width' => 'auto',
'height' => 'auto',
//'show'=>'fade-in',
'hide'=>'fade',
'modal' => true,
'open'=> 'js:function(event, ui) { $(".ui-dialog-titlebar").hide(); }',
'buttons' => array(
Yii::t('app', 'Close') => 'js:function() {$(this).dialog("close");}',
),
)));
?>
<div id="dlg-content" style="dispay:none;"></div>
<?php
$this->endWidget('zii.widgets.jui.CJuiDialog');
?>
The EJuiDateTimePicker works fine when create.php is being run in an entire page. But when I render it inside the CJuiDialog, it is not working. What should I do?

Hey in case someone will happen to encounter the same problem. I have here the solution. In your controller:
if (Yii::app()->request->isAjaxRequest) {
Yii::app()->clientScript->scriptMap['jquery.js'] = false;
yii::app()->clientScript->scriptMap['jquery-ui.min.js'] = false;
$this->renderPartial('create',array(
'model'=>$model,'contr_id'=>$id,
),false,true);}
Just set those two in false and you're good to go.

Related

Dynamic option in select list using TbActiveForm

I have the following code in controller,
$model=new Guessgame('search');
$model->unsetAttributes(); // clear any default values
if(isset($_GET['Guessgame']))
$model->attributes=$_GET['Guessgame'];
$this->render('admin',array(
'model'=>$model,
));
In view file,
<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm',array(
'id'=>'project1-form',
'enableAjaxValidation'=>false,
'htmlOptions' => array('enctype' => 'multipart/form-data','class' => 'well'),
'type' => 'horizontal',
'enableAjaxValidation' => false,
'enableClientValidation' => true,
'clientOptions' => array(
'validateOnSubmit' => true,
)
)); ?>
<p class="help-block">Fields with <span class="required">*</span> are required.</p>
<?php echo $form->errorSummary($model); ?>
<?php echo $form->dropDownListRow($model,'type',array('logo'=>'Logo','apaters'=>'Apaters','text'=>'Text'),array('class'=>'span5','maxlength'=>255)); ?>
The above example the list item are static(logo,aparter and text.
But i want Dynamic values from database. please help me.
you can write below function in model to get values from db
function getValues(){
$crit = new CDbCriteria();
$crit->select = 'name';
$crit->order = 'name';
$data = YourModel::model()->findAll($crit);
$result = CHtml::listData($data,'id','name');
return $result;
}
In view
<?php
echo $form->dropDownListRow($model, 'type', YourModel::model()->getValues(), array('class'=>'span5', 'maxlength'=>255));
?>
Hope so this resolves your problem

Echo current URL id in textfield in yii

I have a category,And I need to create a subcategory of that.
When i tried to create the subcategory i have a field called category Name which should preloaded with the name of category which i wish to create subcategory.
how can i achieve this..
My controller
public function actionCreate($id)
{
$model=new SubCategory;
$mode = Category::model()->findAll();
$mode_1=$this->loadModel1($id);
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if(isset($_POST['SubCategory']))
{
$model->attributes=$_POST['SubCategory'];
if($model->save())
$this->redirect(array('create','id'=>$model->id));
}
$this->render('create',array(
'model'=>$model,
));
}
And the form
<?php
/* #var $this SubCategoryController */
/* #var $model SubCategory */
/* #var $form CActiveForm */
?>
<div class="form">
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'sub-category-form',
// Please note: When you enable ajax validation, make sure the corresponding
// controller action is handling ajax validation correctly.
// There is a call to performAjaxValidation() commented in generated controller code.
// See class documentation of CActiveForm for details on this.
'enableAjaxValidation'=>false,
)); ?>
<?php
$category_id = $_GET['id'];
$category = Category::model()->findByAttributes(array('id' => $category_id));
// echo '<pre>';print_r($category);'</pre>';
?>
<p class="note">Fields with <span class="required">*</span> are required.</p>
<?php echo $form->errorSummary($model); ?>
<div class="row">
<?php echo $form->labelEx($model,'category_id'); ?>
<?php echo $form->textField($model,'category_id',
array('class'=>'form-control','style'=>'width:300px;')); ?>
<?php echo $form->error($model,'category_id'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'subcategory_name'); ?>
<?php echo $form->textField($model,'subcategory_name',array('class'=>'form-control','style'=>'width:300px;')); ?>
<?php echo $form->error($model,'subcategory_name'); ?>
</div>
<div class="row buttons">
<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save',array('class' => 'btn btn-default')); ?>
</div>
<?php $this->endWidget(); ?>
</div><!-- form -->
<div style="width: 97%; margin: auto;" >
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'fav-category-grid',
'dataProvider'=>$model->search(),
//'filter'=>$model,
'columns'=>array(
// 'id',
//'favcategory',
array('header'=>'#','htmlOptions'=>array('width'=>'60px'),
'value'=>'$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)',
),
//'id',
//'category_id',
array(
'name' => 'category_id',
'value' => '$data->category->categoryname',
//'filter'=> CHtml::listData(Category::model()->findAll(array('order'=>'categoryname')), 'categoryid', 'categoryname')
),
'subcategory_name',
array(
'class' => 'CButtonColumn',
'htmlOptions'=>array('width'=>'110px'),
'template' => '{update}{delete}',
'buttons' => array(
'update'=>array(
'imageUrl' =>false,
'label' => '',
'options' => array('title'=>'update','class'=>'btn btn-info btn-xs fa fa-pencil-square-o'),
),
'delete'=>array(
'imageUrl' =>false,
'label' => 'delete',
'options' => array('title'=>'view','class'=>'btn btn-danger btn-xs'),
),
)
),
),
'itemsCssClass'=>'table table-striped table-bordered table-hover',
'pagerCssClass'=>'pagination',
'pager'=>array( 'header' => '','lastPageLabel'=>'<span class="glyphicon glyphicon-chevron-right"></span><span class="glyphicon glyphicon-chevron-right"></span>','firstPageLabel'=>'<span class="glyphicon glyphicon-chevron-left"></span><span class="glyphicon glyphicon-chevron-left"></span>','prevPageLabel'=>'<span class="glyphicon glyphicon-chevron-left"></span>','nextPageLabel'=>'<span class="glyphicon glyphicon-chevron-right"></span>','header' => '','cssFile' => Yii::app()->baseUrl . '/css/pager.css','htmlOptions'=>array('class'=>'pagination'),'selectedPageCssClass'=>'active'),
)); ?>
</div>
I can see category model $category getting loaded in the form.
$category = Category::model()->findByAttributes(array('id' => $category_id));
And if id in category table is primary key, then I suggest, just for simplicity:
$category = Category::model()->findByPk($category_id);
Now I am guessing you may want that in textField which will be disabled.
So use textField() of CActiveForm in the form, something like:
$form->textField($category, 'name', array('disabled' => 'disabled'));
textField docs
Note: The second parameter must be the attribute name, I have assumed name.
Also I don't see the use of the following two lines in actionCreate(). I mean, the variable $mode and $mode_1 are not used anywhere in that action.
$mode = Category::model()->findAll();
$mode_1=$this->loadModel1($id);

Pagination fetching all records without filtering in YII

I am new to Yii. I have done a normal criteria search, and rendering them in the Grid view in Yii. If I click on the second page after searching/filtering, it again gives me the whole set of records in the Grid view.
My View:
<div class="form">
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'nimsoft-alerts-form',
// Please note: When you enable ajax validation, make sure the corresponding
// controller action is handling ajax validation correctly.
// There is a call to performAjaxValidation() commented in generated controller code.
// See class documentation of CActiveForm for details on this.
'enableAjaxValidation'=>false,
)); ?>
<h1>Missing Hosts List</h1>
<?php //echo $form->errorSummary($model); ?>
<div style="float:left;">
<div class="row">
<?php echo $form->labelEx($model,'host_start_date'); ?>
<?php
Yii::import('application.extensions.CJuiDateTimePicker.CJuiDateTimePicker');
$this->widget('CJuiDateTimePicker', array(
'attribute' => 'host_start_date',
'language' => '',
'model' => $model,
'options' => array(
'mode' => 'focus',
'dateFormat' => 'yy-mm-dd',
//'minDate'=>'0',
'showAnim' => 'slideDown',
),
'htmlOptions' => array(
'style'=>'height:20px;',
'value' => $model->host_start_date,
),
));
?>
<?php echo $form->error($model,'host_start_date'); ?>
</div>
</div>
<div style="float:left;"> </div>
<div style="float:left;">
<div class="row">
<?php echo $form->labelEx($model,'host_end_date'); ?>
<?php
Yii::import('application.extensions.CJuiDateTimePicker.CJuiDateTimePicker');
$this->widget('CJuiDateTimePicker', array(
'attribute' => 'host_end_date',
'language' => '',
'model' => $model,
'options' => array(
'mode' => 'focus',
'dateFormat' => 'yy-mm-dd',
//'minDate'=>'0',
'showAnim' => 'slideDown',
),
'htmlOptions' => array(
'style'=>'height:20px;',
'value' => $model->host_end_date,
),
));
?>
<?php echo $form->error($model,'host_end_date'); ?>
</div>
</div>
<div class="row buttons">
<?php echo CHtml::button('Search',array('submit' => array('Site/index')));?>
<?php echo CHtml::button('Search and Export',array('submit' => array('Site/Export')));?>
</div>
<?php $this->endWidget(); ?>
<!--<div class="row buttons">
<a href="<?php //echo $this->createUrl('Site/Index',array('id'=>$cust_id,'isXLSDownload'=>1));?>" title="Export For All Customers" class="btn btn-primary circle_ok" style="text-decoration: none; color:#FF3333;" ><b>Export All</b></a>
</div>-->
<?php
$this->widget('zii.widgets.grid.CGridView', array(
'dataProvider'=>$dataProvider,
'enableSorting' => false,
'columns'=>array(
array( // display 'create_time' using an expression
'name'=>'alert_device',
'value'=>'$data->alert_device',
),
array( // display 'create_time' using an expression
'name'=>'alert_event_time',
'value'=>'$data->alert_event_time',
),
array( // display 'create_time' using an expression
'name'=>'alert_datetime',
'value'=>'$data->alert_datetime',
),
),
//'itemView'=>'_view',
));
?>
</div>
My Action:
public function actionIndex()
{
//$this->layout=false;
$model=new NimsoftAlerts;
if(isset($_POST['NimsoftAlerts']))
{
$model->attributes=$_POST['NimsoftAlerts'];
if($model->validate())
{
$pagination=1;
$criteria = new CDbCriteria();
$criteria->condition = "alert_datetime >= '$model->host_start_date' and alert_datetime <= '$model->host_end_date' and alert_itsm_ack_status IS NULL";
$details = NimsoftAlerts::model()->findAll($criteria);
$dataProvider=new CActiveDataProvider('NimsoftAlerts',array(
'criteria' => $criteria,));
}
else $dataProvider=new CActiveDataProvider('NimsoftAlerts');
// if(isset($pagination))
// {
// $dataProvider=new CActiveDataProvider('NimsoftAlerts',array(
// 'criteria' => $criteria,));
// }
}
else
{ $dataProvider=new CActiveDataProvider('NimsoftAlerts'); }
if($_REQUEST['isXLSDownload']=='1')
{
$xlsName='Missing_Host_Details_'.date('YmdHis').'.xls';
$sheetName='Missing Host Details';
$headerTxt='Host Details';
$arrTh=array(
'alert_device'=>array('label'=>'Alert Device'),
'alert_event_time'=>array('label'=>'Alert Event Time'),
'alert_datetime'=>array('label'=>'Alert Datetime'),
);
$this->generateCXLS($xlsName,$sheetName,$criteria,$model,$headerTxt,$arrTh);
//GlobalFuncs::generateCXLS($xlsName,$sheetName,$criteria,$model,$headerTxt,$arrTh);
}
$nimsoftAlerts = new NimsoftAlerts;
$viewNimsoftTktSts = $nimsoftAlerts->dispNimsoftTktSts();
// renders the view file 'protected/views/site/index.php'
// using the default layout 'protected/views/layouts/main.php'
$this->render('index',array(
'viewNimsoftTktSts'=>$viewNimsoftTktSts,
'dataProvider'=>$dataProvider,
'model'=>$model,
));
}
On clicking the pagination buttons, this is what gets called -
$dataProvider=new CActiveDataProvider('NimsoftAlerts');
and not
if(isset($_POST['NimsoftAlerts'])) { [......] }.
So try this -
$model=new NimsoftAlerts;
$model->unsetAttributes(); // clear any default values
//Removed the content from here.
if(isset($_POST['NimsoftAlerts']))
{
$model->attributes=$_POST['NimsoftAlerts'];
if($model->validate())
{
[.....]
}
else {
$dataProvider = $model->search();
}
}
else {
$dataProvider = $model->search();
}
The $model->search() will add the filters and the pagination would include the filtered values received from $_GET[].
I hope it helps.
It seems that the selected dates from your custom search form does not get send when the pagination is used and so all records are fetched. So you have to send them manually.
I have implemented the same scenario in my sample project. Try to resemble it in your project.
In your view file -
//Your form has datepicker, this form has a textbox. On submit the values are posted to apply the filter.
<form id="filter_form" method="POST">
<input name="Skill[name]" id="Skill_name" value="<?php echo $model->name; ?>" />
<input type="submit" name="submit_btn" id="submit_btn" value="Submit" />
</form>
<script>
$(document).ready(function() {
$('.page a').click(function(ev) {
ev.preventDefault();
$.fn.yiiGridView.update('skill-grid', {data: $('#filter_form').serialize()}); //This will include the values from the form (dates in your case)
return false;
});
});
</script>
In your controller-action -
$model = new Skill;
$model->unsetAttributes();
if(isset($_REQUEST['Skill'])) {
$model->attributes = $_REQUEST['Skill'];
}
$dataProvider = $model->search();
$this->render('admin', array(
'dataProvider' => $dataProvider,
'model' => $model,
));`
Important Note: Replace the 'Skill' Model name with 'NimsoftAlerts'.
I hope it helps.

Using Ajax in Yii.?

I am working on job portal,and have a search module for employers to search for application.I want to use ajax to list the application after search, listing the results in the same page.How should I do it.?,Below is the screenshot of the module.Have tried the following things.
//Contoller Code//
public function actionSearch()
{
$model = new SearchEmployee();
/*Getting Data From Search Form For Processing */
if (isset($_POST['SearchEmployee'])) {
$model->attributes = $_POST['SearchEmployee'];
$category = $_POST['SearchEmployee']['category'];
$skills = $_POST['SearchEmployee']['skills'];
$experience = $_POST['SearchEmployee']['experience'];
$ajaxmodel = SearchEmployee::model()->find(array(
'select' => array('*'), "condition" => "category_id=$category AND key_skills like'%$skills%'AND experience=$experience",
));
if($model==null)
{
Yii::app()->user->setFlash('success', "No Results");
$this->renderPartial('search');
}
else
{
$this->renderPartial('search', array('model' => $ajaxmodel));
Yii::app()->end();
}
}
// In views,Not posting full codes just codes to show the ajax results,//
<div class="view">
<h1>Results </h1>
<div class="view" id="id">
<h1> Records Display </h1>
<h4>Name: <?php echo $form->labelEx($model,'skills Required'); ?></h4>
<h4>Skills: <?php echo $form->labelEx($model,'Skills Required'); ?></h4>
<h4>Experience: <?php echo $form->labelEx($model,'Skills Required'); ?></h4>
<h5> <?php echo CHtml::submitButton('VIew Details'); ?></h5>
</div>
</div>
Is this way to do...
In your view just enable ajax, for example:
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
'id' => 'client-document-form',
'method' => 'post',
'action' => $url,
'enableAjaxValidation' => false,
'errorMessageCssClass' => 'required_field_text'
)); ?>
This line enableAjaxValidation => true need be true also in your actions add this line $this->performAjaxValidation($model);
UPDATE:
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
'id'=>'update-profile-form',
'enableAjaxValidation' => true,
'errorMessageCssClass' => 'required_field_text',
'clientOptions' => array(
'validateOnSubmit' => true,
'validateOnChange' => false,
'hideErrorMessage' => true,
'beforeValidate' => 'js:function(form) {
return validate.beforeValidate("update-profile-form");
}',
'afterValidate' => 'js:function(form, data, hasError) {
validate.afterValidate(data, "update-profile-form");
}'
),

How to get the checkbox value from cgridview?

Q : how to get the checkbox value from cgridview?
Status : I create cgridview in a popbox with CJuiDialog. But I can't get the value of checkbox from grid view. I got 500 error.
This is my view to open the popup box
<div style="height:50px;">
<?php $imghtml=CHtml::image(Yii::app()->request->baseUrl.'/images/assets/approver.png','', array('style'=>'margin: 5px 0;')); ?>
<?php echo CHtml::ajaxLink(
Yii::t('accrecei',$imghtml),
$this->createUrl('implementer/Approverlist', array('id'=>$model->id)),
array(
'onclick'=>'$("#accreceilist").dialog("open"); return false;',
'update'=>'#reviewerlist'
),
array(
'id'=>'showaccreceilist',
'class'=>'btn btn-info',
'title'=>'Add/Remove reviewer',
'style'=>'width:25px; float:right; margin-button:20px;',)
);?>
<div id="reviewerlist"></div>
</div>
This is the popup box
<?php
$this->beginWidget('zii.widgets.jui.CJuiDialog',array(
'id'=>'reviewerlist',
'options'=>array(
'title'=>Yii::t('accrecei','Reviewer List'),
'autoOpen'=>true,
'modal'=>'true',
'width'=>'750',
'height'=>'500',
),
));
//echo $this->renderPartial('_listing', array('model'=>$model, 'acccategory'=>$acccategory,'job'=>$job)); ?>
<?php $this->renderPartial('_listing',array('model' => $model,'arr_reviewer' => $arr_reviewer, 'current_reviewers'=> $current_reviewers),false,true); ?>
<?php $this->endWidget('zii.widgets.jui.CJuiDialog');?>
This is the grid view "_listing.php"
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'job-form',
'enableAjaxValidation'=>true,
)); ?>
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'acc-recei-grid',
'dataProvider'=>$model->search_reviewerlist(),
'filter'=>$model,
'columns'=>array(
array(
'class' => 'CCheckBoxColumn',
'selectableRows' => 2,
'checkBoxHtmlOptions' => array(
'name' => 'userids[]',
),
'value'=>'$data->id',
//'checked'=>'(in_array($data->id, $current_reviewers) ? 1 : ""',
'checked'=>function($data, $row) use ($current_reviewers){
return in_array($data->id, $current_reviewers);
}
),
'username',
array(
'type'=>'raw',
'value'=>'$data->id',
//'filter'=>array('style'=>'visible:none'),
//'headerHtmlOptions'=>array('style'=>'width:0px; display:none; border:none; textdecoration:none'),
'htmlOptions'=>array('style'=>'display:none; border:none;', 'class'=>'user-id'),
//'header'=>false,
//'filter'=>false,
),
),
)); ?>
<div align="center">
<?php echo CHtml::ajaxSubmitButton(Yii::t('reviewer','Update'),Yii::app()->createUrl('implementer/updatereviewer',array('id'=>$model->id)),array('success'=>'js: function(data) {
$("#reviewerlist").dialog("close");
}'),array('id'=>'closeJobDialog')); ?>
</div>
<?php $this->endWidget(); ?>
This is my controller function to get the value of checkbox
public function actionUpdatereviewer()
{
var_dump($_POST['userids']);
echo 'debug';
echo $_GET['id'];
die;
}
Thank you for your any advice.
I got it by Myself
This my view
<div style="height:50px;">
<?php $imghtml=CHtml::image(Yii::app()->request->baseUrl.'/images/assets/approver.png','', array('style'=>'margin: 5px 0;')); ?>
<?php echo CHtml::ajaxLink(
Yii::t('customer_id',$imghtml),
$this->createUrl('implementer/approverlist', array('id'=>$model->id)),
array(
'onclick'=>'$("#reviewerlist").dialog("open"); return false;',
'update'=>'#reviewerlist'
),
array('id'=>'reviewer-link',
'class'=>'btn btn-info',
'title'=>'Add/Remove reviewer',
'style'=>'width:25px; float:right; margin-button:20px;',)
);?>
<div id="reviewerlist"></div>
</div>
This is _list.php (render from popup box as my question)
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'job-form',
'enableAjaxValidation'=>true,
)); ?>
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'acc-recei-grid',
'dataProvider'=>$model->search_reviewerlist(),
'filter'=>$model,
'columns'=>array(
array(
'class' => 'CCheckBoxColumn',
'selectableRows' => 2,
'checkBoxHtmlOptions' => array(
'name' => 'userids[]',
),
'value'=>'$data->id',
'checked'=>function($data, $row) use ($current_reviewers){
return in_array($data->id, $current_reviewers);
}
),
'username',
),
)); ?>
<div align="center">
<?php echo CHtml::ajaxSubmitButton(Yii::t('reviewer','Update'),Yii::app()->createUrl('implementer/updatereviewer',array('id'=>$model->id)),array('success'=>'js: function(data) {
$("#reviewerlist").dialog("close");
}'),array('id'=>'closeJobDialog')); ?>
</div>
<?php $this->endWidget(); ?>
This is my controller
public function actionApproverlist($id)
{
$users = new Users('reviewerlist');
//$users->scenario = "reviewerlist";
$users->unsetAttributes(); // clear any default values
if(isset($_GET['Users']))
$users->attributes=$_GET['Users'];
$model = $this->loadModel($id);
$arr_reviewer = Users::model()->get_reviewers();
$current_reviewers = explode( ',', $model->reviewers );
$reviewer_lastcomment = Yii::app()->generals->last_comment($model, $current_reviewers);
$this->renderPartial('listing',array('model' => $users, 'arr_reviewer' => $arr_reviewer, 'current_reviewers'=> $current_reviewers),false,true);
}
public function actionUpdatereviewer()
{
var_dump($_POST['userids']);
}
check $_POST['userids'] at your firebug->network. you will see the value of $_POST['userids'].
Let dance with yii. Cheeer!!!

Categories