ajaxLink $ajaxOptions 'update' parent window?

How do i specify the parent window on ‘update’ ajaxOption ???

echo CHtml::ajaxLink(

                     'Delete from project',



                            'update' => '#index',








When you use ajax links like that you have to create a div and replace his content.

This is the tipical scenario:

In the view:

<div id="index">

    <?php $this->renderPartial('_subview');?>


The ajax link:

<?php echo CHtml::ajaxLink(



      'update' => '#index',



And the controller will do a render partial on the subview, not on the whole view.

If you have to replace the whole view you can create the div in layout/main around $content

<div id="difForAjaxReplaceOfTheWholeView">

    <?php echo $content?>


Yes i understand that but i got two problems… first is i want to update the window.parent.document because i’m opening a lightbox with iframe and when i click a ajaxlink inside that iframe i want to update content of parent window.

I know jQuery parameter ‘success’ can do that like this:

'success' => 'function(data) 


    $("#teste", window.parent.document).html("File '.$id_file.' added with success to project '.$id_project.'"); 



But i want this on ‘update’ or ‘replace’ parameters…

Second problem is that on the parent window i got the list of Files added to that project. All File got an ajax link to delete the file from the project… the problem is when i 1 link is ok… when i click the second time after page was rendered i got an error:



CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘’ at line 1

Source File


Just for the record, CHtml itself uses ‘success’














But it dont allow second parameter like:

("#contentDiv", window.parent.document)