Tuesday, 15 January 2013

php - Second dialog box doesn't show -



php - Second dialog box doesn't show -

i'm developping yii framework. create 2 dialog boxes in yii page create model. first 1 pops correctly, sec 1 doesn't. i've written view file. view.php follow:

<?php $this->menu=array( //array('label' => yii::t('app', 'publier à united nations contact'), 'url' => array('publieracontact', 'id_p'=> $model->id_publication, 'id_e' => $model->id_evenement)), array('label' => yii::t('app', 'publier à united nations contact'), 'url' =>'#','linkoptions' => array( 'onclick' => "{publieracontact(); $('#dialogcontact').dialog('open');}", )), array('label' => yii::t('app', 'publier à united nations groupe'), 'url' => '#', 'linkoptions' => array( 'onclick' => "{publieragroupe(); $('#dialoggroupe').dialog('open');}", )) ); $this->beginwidget('zii.widgets.jui.cjuidialog', array( 'id' => 'dialogcontact', 'options' => array( 'title' => 'publier à united nations contact', 'autoopen' => false, 'modal' => true, 'width' => 550, 'height' => 200, ), )); echo "<div class='divforform'></div>"; $this->endwidget('zii.widgets.jui.cjuidialog'); $this->beginwidget('zii.widgets.jui.cjuidialog', array( 'id' => 'dialoggroupe', 'options' => array( 'title' => 'publier à united nations groupe', 'autoopen' => false, 'modal' => true, 'width' => 550, 'height' => 200, ), )); echo "<div class='divforform'></div>"; $this->endwidget('zii.widgets.jui.cjuidialog'); ?> <script type='text/javascript'> function publieracontact() { <?php echo chtml::ajax(array( 'url' => array('publication/publieracontact', 'id_p'=>$id_p, 'id_e' =>$id_e), 'data' => "js:$(this).serialize()", 'type' => 'post', 'datatype' => 'json', 'success' => "function(data) { if(data.status == 'failure') { $('#dialogcontact div.divforform').html(data.div); //here trick: on submit-> 1 time 1 time again function! $('#dialogcontact div.divforform form').submit(add); } else { $('#dialogcontact div.divforform').html(data.div); settimeout(\"$('#dialogcontact').dialog('close');refreshdisciplines();\", 1000); document.location.reload(); } }" ));?> homecoming false; } function publieragroupe() { <?php echo chtml::ajax(array( 'url' => array('publication/publieragroupe', 'id_p' => $id_p, 'id_e' => $id_e), 'data' => "js:$(this).serialize()", 'type' => 'post', 'datatype' => 'json', 'success' => "function(data) { if(data.status == 'failure') { $('#dialoggroupe div.divforform').html(data.div); //here trick: on submit-> 1 time 1 time again function! $('#dialoggroupe div.divforform form').submit(add); } else { $('#dialoggroupe div.divforform').html(data.div); settimeout(\"$('#dialoggroupe').dialog('close');refreshdisciplines();\", 1000); document.location.reload(); } }" ));?> homecoming false; } </script>

unfortunately, sec dialog can not appear. can help me know what's wrong ?

edit :

the function must called :

'onclick' => "{publieragroupe(); $('#dialogcontact').dialog('open');}",

as function's identifier publieragroupe.

php jquery yii modal-dialog

No comments:

Post a Comment