Return Renderpartial Include Widget

Hi guys,

I have a document upload form. it’ll return another upload form view on completed.

I used plupload at http://www.yiiframework.com/extension/pupload for main upload form,

and used eajaxupload at http://www.yiiframework.com/extension/eajaxupload for 2nd upload form.

I tried to return renderPartial which include eajaxupload widget by json_encode. But it’s always display:


<noscript>Please enable javascript</noscript>

Controller:


$html = $this->renderPartial('success', array('model'=>$model),true, true);

echo json_encode(array('error'=>'none','html'=>$html));

View:

Main upload view:




<?php $this->widget('application.extensions.Plupload.PluploadWidget', array(

	'config' => array(

		'runtimes' => 'html5',

		'url' => $this->createUrl('upload/upload'),

		'unique_names' => true,

		'filters' => array(

			array('title' => Yii::t('app', 'Images files'), 'extensions' => 'pdf,doc,docx,ppt,pptx,pot,potx'),

		),

		'max_file_number' => 10,

		'autostart' => true,

		'jquery_ui' => false,

	),

	'callbacks' => array(

		'FileUploaded' => 'function(up,file,response){completeUpload(response.response);}',

	),

	'id' => 'mainWrap'

));

?>

<ul id="upload_filelist" class="plupload_done">

</ul>

<script>

    function completeUpload(data){

        data = jQuery.parseJSON(data);

        $('#upload_filelist').append(data.html);

    }

</script>



Success view:


<?php $this->widget('ext.EAjaxUpload.EAjaxUpload',

array(

	'id'=>'documentImageUpload',

	'config'=>array(

		'action'=>Yii::app()->createUrl('upload/uploaddocumentimage',array('id'=>$model->id)),

		'allowedExtensions'=>array("jpg","jpeg","gif","png"),

		'sizeLimit'=>2*1024*1024,

		

	)

)); ?>

someone can help me resolve it?

I resolved it by write this extension Nava-jcrop