- Actualización del estado de un candidato a través de una ventana modal.

- Actualización framework YII

git-svn-id: https://192.168.0.254/svn/Proyectos.Incam_IntranetNueva/trunk@72 77cfc57b-8ef4-1849-9df6-4a38aa5da120
This commit is contained in:
David Arranz 2012-07-30 08:34:10 +00:00
parent 23e0eb0681
commit 89fd23a7f6
3 changed files with 8 additions and 30 deletions

View File

@ -23,22 +23,6 @@ echo $form->dropDownList(
?> ?>
<br clear="all" /> <br clear="all" />
<?php
//echo CHtml::ajaxSubmitButton(Yii::t('intranet', 'Choose'), "");
/*,
CHtml::normalizeUrl(array('candidato/update', 'id' => $model->id)),
array(
"data"=>array("id"=>$model->id),
"success"=>"function(data){
if (data.status == \"failure\") {
alert(\"mal\");
} else {
alert(\"bien\");
}
}"
)
);*/
?>
<?php $this->endWidget(); ?> <?php $this->endWidget(); ?>

View File

@ -37,12 +37,10 @@ $('.search-form form').submit(function(){
$updateJS = CHtml::ajax( array( $updateJS = CHtml::ajax( array(
'url' => "js:url", 'url' => "js:url",
'data' => "js:form.serialize()", 'data' => "js:form.serialize()",
'type' => 'post', 'type' => "post",
'dataType' => 'json', 'dataType' => "json",
'success' => "function( data ) 'success' => "function( data ) {
{
if( data.status == 'failure' ) { if( data.status == 'failure' ) {
jQuery.blur(div.grid-view);
setTimeout( \"jQuery( '#dlg-updateestado' ).dialog( 'close' );\", 1000 ); setTimeout( \"jQuery( '#dlg-updateestado' ).dialog( 'close' );\", 1000 );
} else { } else {
if( data.status == 'success' ) // Update all grid views on success if( data.status == 'success' ) // Update all grid views on success
@ -66,7 +64,6 @@ function updateEstado( url )
if(!url) { if(!url) {
//action = '&action=' + act; //action = '&action=' + act;
url = form.attr( 'action' ); url = form.attr( 'action' );
console.log('url => ' + url);
} }
{$updateJS} {$updateJS}
}"); }");
@ -172,13 +169,10 @@ $this->endWidget('zii.widgets.jui.CJuiDialog');
CHtml::encode($data->estado), CHtml::encode($data->estado),
array("candidato/updateEstado"), array("candidato/updateEstado"),
array( array(
"data"=>array("id"=>$data->id), "data" => array("id" => $data->id),
"success"=>"function(data){ "success" => "function(data){
if (data.status == \"failure\") { jQuery(\"#dlg-updateestado\").html(data);
} else { jQuery(\"#dlg-updateestado\").dialog(\"open\");
jQuery(\"#dlg-updateestado\").html(data);
jQuery(\"#dlg-updateestado\").dialog(\"open\");
}
}", }",
), ),
array( array(