0
我想调用ajax()后在iFrame设计中保存一个方法。 Iframe设计包含cgridview,在使用文档写入“Ajax onsuccess”上的Iframe内容后,我正面临分页问题。在CGridView分页iframe问题 - Yii框架
阿贾克斯邮编:
$.ajax({
type: 'POST',
url: '<?php echo Yii::app()->createUrl("form/FormResponse"); ?>',
data: responsedata,
success:function(data){
var iframe = document.getElementById('cru-frame-resgrid');
if(data !='')
{
iframe.contentWindow.document.write(data); // writing content to iframe here
iframe.contentWindow.document.close();
}
},
error: function(data) { // if error occured
},
dataType:'html'
});
控制器代码:
public function actionFormResponse()
{
............
............
echo $this->renderPartial('response',array( 'model'=>$model,'base'=>$model->crm_base_contact_form_id,'tabid'=>$model->st_tabno,'quesid'=>$model->crm_campaign_script_question_id,
));
}
此的RenderPartial不渲染页面其涉及到阿贾克斯的onSuccess,所以我写了这个代码中添加iframe中的内容,但现在面临的分页问题写数据后,
iframe.contentWindow.document.write(data); // writing content to iframe here
iframe.contentWindow.document.close();
请任何人指导我解决 这个问题。
仍然面临CgridView分页错误“未定义的索引:基地”。 echo $ this-> renderPartial('response',array('model'=> $ model,'base'=> $ model-> crm_base_contact_form_id,'tabid'=> $ model-> st_tabno,'quesid'=> $ model - > crm_campaign_script_question_id, )); –
“undefined index:base” - 这不是分页错误 – Alex
第一次cgridview分页工作正常。在将内容写入ajaxsuccess cgridview分页的iframe后,对于呈现的视图不起作用。如果可以在浏览 –