Hi Asgaroth,
Thanks for your swift response. I've added the code snippet,
My site Index file:
-------------
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'assessment-form',
'enableAjaxValidation'=>false,
));
echo $form->hiddenField($model,'File',array('size'=>60,'maxlength'=>255));
?>
<?php $this->endWidget(); ?>
<?php
$this->widget('xupload.XUpload', array(
'url' => Yii::app()->createUrl("site/upload"),
'model' => $xuploadform,
'attribute' => 'file',
'multiple' => true,
//'formView' => 'application.views.user._form',
'uploadTemplate' => '#template-upload',
'options' => array(
'sequentialUploads' => true,
'acceptFileTypes' => 'js:/(\.|\/)(CSV|ZIP)$/i',
'completed' => 'js:function (event, files, index, xhr, handler, callBack) {
$("#Assessment_File").val(\'\'+handler.response.name + \'\' );
}'
),
));
?>
<div class="Assessment">
<?php
echo $out1;
?>
</div>
~
2. My Site controller:
------------------
public function actions()
{
Yii::import("xupload.models.XUploadForm");
return array(
'upload'=>array(
'class'=>'xupload.actions.XUploadAction',
'path' =>Yii::app() -> getBasePath() . "/../uploads/",
'publicPath' => Yii::app() -> getBaseUrl() . "/uploads",
'subfolderVar'=>'parent_id',
),
);
}
3. It just uses another view to render data where first half is Xupload and rest is populated with Assessment model filtered data,
Assessment Index:
--------------
h1>Assessments</h1>
<?php
$this->widget('zii.widgets.jui.CJuiButton', array(
'name'=>'Data',
'caption'=>'Data',
'buttonType' => 'link',
//'url' => array('//JobsThroughPut/index'),
'id' => 'Data-id',
));
$this->widget('zii.widgets.jui.CJuiButton', array(
'name'=>'Reports',
'caption'=>'Reports',
'buttonType' => 'link',
//'url' => array('//JobsThroughPut/index'),
'id'=>'btn-link',
));
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'assessment-grid',
'dataProvider'=>$dataProvider,
'columns'=>array(
'id' => array('name' => '', 'type'=> 'raw', 'value'=>'CHtml::checkBox("checkbox-id",$checked=false,array("id"=>$data->id, "class"=>"my-checkboxes"))'),
/* 'user_id', */
'fromid',
'cc',
'created_date',
'lastupdate',
'modeType',
'File',
'Status',
),
));
?>
<script type="text/javascript">
$(document).ready(function(){
$(".my-checkboxes").bind('click', function(){
var id = $(this).attr('id');
$("#btn-link").attr('href', '../jobsPerHour/getchart/ass_id/'+id);
$("#Data-id").attr('href', '../jobsPerHour/index/ass_id/'+id);
});
});
</script>
Thanks again for all your help.
Regards,
Amar.