Reputation: 15
since three hours I don't found the error in jquery. I try to refresh a div, after I've created a file
Here is my View
<?php
echo CHtml::ajaxLink('Neuen Export erstellen',
Yii::app()->createUrl('exporter/create' ),
array(
'data' => array(),
'dataType' => 'json',
'type' => 'POST',
'complete' => "js:function(html){
$('#export-grid').fadeOut().fadeIn();
}",
'success' => "js:function(html){
$('#export-grid').replaceWith();
}"
),
array(
'class' => 'c2a_gray alignright',
'style' => 'font-size: 12px',
)
);
?>
** My Controller **
public function actionCreate()
{
// createfile();...
// do some stuff
$this->renderPartial('//users//exporter//_tmo', true, true);
}
complete Option works in ajaxLink function very well but if I put alert(html) inside complete I got "Object object"
I don't know how to update export-grid with the new content.
please help me! thx!
Upvotes: 0
Views: 1065
Reputation: 349
Yes if you try to alert html then it will return Object. Please try alert(html.responseText).
Upvotes: 1