Yii Framework Forum: [EXTENSION] quickdlgs - Yii Framework Forum

Jump to content

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

[EXTENSION] quickdlgs Rate Topic: -----

#21 User is offline   pod2g 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 17
  • Joined: 20-May 12

Posted 18 September 2012 - 10:19 PM

Hi Joblo,

Again, many thanks for a great contribution.
I've used your extension in my project and almost everything is working fine.

However, I have encountered an issue while I am trying to implement pagination inside dialog popup.
Ajax does not work inside the dialog, every time i move to next page the dialog popup close and bring me to the main white window.
I attached two images this would explain the cause :)

Thanks in advance for your respond.


Thanks,
pod2g

Attached File(s)


0

#22 User is offline   pod2g 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 17
  • Joined: 20-May 12

Posted 18 September 2012 - 11:39 PM

Hello Joblo,

Plz, ignore my question here, stupid me I forgot to see your note
"You will have problems if you show list, create, update, admin action views inside an ajax-dialog, because the javascript (pagination ...) will not work as expected."

I have changed to use iframe-dialog and it works like a charm.

Million thanks for a great extension.

Thanks,
pod2g


View Postpod2g, on 18 September 2012 - 10:19 PM, said:

Hi Joblo,

Again, many thanks for a great contribution.
I've used your extension in my project and almost everything is working fine.

However, I have encountered an issue while I am trying to implement pagination inside dialog popup.
Ajax does not work inside the dialog, every time i move to next page the dialog popup close and bring me to the main white window.
I attached two images this would explain the cause :)

Thanks in advance for your respond.


Thanks,
pod2g

0

#23 User is offline   Denis Roussel 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 36
  • Joined: 28-October 11

Posted 20 September 2012 - 10:42 AM

Hi there,


I have embedded the extension in a simple widget :

A button and some text.

The button click opens a dialog to update DB (iframeButton).

I want to update the widget content after closing the dialog (like refreshing a Grid) as the widget text content may differ with DB values but without reloading the whole page...

I did not find any solution in any forum.

If you have any clue for me, that could be great !


Many thanks.

PS : I posted also in the general discussion as it could be a more general subject too (Ajax) : http://www.yiiframew...ialog-and-ajax/
0

#24 User is offline   Joblo 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 580
  • Joined: 12-September 10
  • Location:Austria

Posted 30 September 2012 - 05:55 AM

You can add a custom js-script as param of the function 'EQuickDlgs::checkDialogJsScript()'.
This will be executed after dialog close. See the source of checkDialogJsScript().


public function actionUpdate($id)
{
    ....
 
        if(model->save())
        {
            //close the dialog and update the grid instead of redirect if called by the update-dialog

            $customJsScript = "alert('test');window.parent.$('#someelementid').dosomething(); ......";
            EQuickDlgs::checkDialogJsScript($customJsScript);

            $this->redirect(array('admin','id'=>$model->id));
        }
 
        //check if the iframe layout (or renderPartial) has to be used
        EQuickDlgs::render('update',array('model'=>$model));
        //$this->render('update',array('model'=>$model));
}


0

#25 User is offline   Deepak Pradhan 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 209
  • Joined: 01-May 09
  • Location:Charlotte, NC

Posted 11 October 2012 - 04:55 PM

Dialog for update and delete works.

Having trouble with View from Admin: The DIV id is not getting created for some reason.


Error: TypeError: $("#mygrid_c8viewWdgt-dlg").dialog is not a function


0

#26 User is offline   yiqing95 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 586
  • Joined: 27-December 10
  • Location:china

Posted 13 October 2012 - 07:08 AM

View PostJoblo, on 30 September 2012 - 05:55 AM, said:

You can add a custom js-script as param of the function 'EQuickDlgs::checkDialogJsScript()'.
This will be executed after dialog close. See the source of checkDialogJsScript().


public function actionUpdate($id)
{
    ....
 
        if(model->save())
        {
            //close the dialog and update the grid instead of redirect if called by the update-dialog

            $customJsScript = "alert('test');window.parent.$('#someelementid').dosomething(); ......";
            EQuickDlgs::checkDialogJsScript($customJsScript);

            $this->redirect(array('admin','id'=>$model->id));
        }
 
        //check if the iframe layout (or renderPartial) has to be used
        EQuickDlgs::render('update',array('model'=>$model));
        //$this->render('update',array('model'=>$model));
}



if support the refreshListViewId(refreshListId) it will be better . :lol: although it can achieved this way
0

#27 User is offline   Denis Roussel 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 36
  • Joined: 28-October 11

Posted 28 November 2012 - 04:15 AM

Hi,


I'm implementing the iframe dialog to make some action updates.

I want to make actions and re-render the dialog => I want to make 'steps' with the same iframe dialog.

Is it possible?


Many thanks
0

#28 User is offline   maxtorchel 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 26-January 13

Posted 08 February 2013 - 10:16 AM

how can i set a dynamic dialog title from dataProvider? 'dialogTitle' => '$data->name' dont work.
0

#29 User is offline   Cait 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 26-June 12

Posted 13 April 2013 - 01:26 AM

View Postyiqing95, on 13 October 2012 - 07:08 AM, said:

if support the refreshListViewId(refreshListId) it will be better . :lol: although it can achieved this way


That EQuickDlgs::checkDialogJsScript($customJsScript); method is in Controller itself.

How could i pass some $data = array(...) from that controller to that $customJsScript ?

I need to update a form dropdown like this:


FORM:

 <?php echo $form->dropDownListRow($model, 'actividad_id',$actividades, 
                                   array(
                                       'style'=>'width:100%;',
                                       'empty'=>'Seleccione Actividad',
                                       'errorOptions'=>array('style'=>'display:none;'),  
                                       'labelOptions'=>array('style'=>'display:none;')
                                   )); ?>
         
                    <?php EQuickDlgs::iframeButton(
                                array(
                                    'controllerRoute' => '/actividades/ajaxCreateFromInteraccion',
                                    'urlParams'=>array('id_proceso'=>$id_proceso, 'ajaxRequest'=>1),
                                    'hideTitleBar' => true,
                                    'dialogTitle' => 'Crear nueva actividad',
                                    'dialogWidth' => 550, 
                                    'dialogHeight' => 335,
                                    'openButtonText' => 'Nueva Actividad',
                                    'closeButtonText' => 'Cerrar',
                                    'closeOnAction' => true, //important to invoke the close action in the 
          
                                ) 
                            );
                   ?>
 
CONTROLLER ACTION:

  public function actionAjaxCreateFromInteraccion($id_proceso=null)
	{
              if(isset($_GET['ajaxRequest']) && $_GET['ajaxRequest']== 1){
                  
                    $model=new Actividades;
                    $model->proceso_id = $id_proceso;

                    if(isset($_POST['Actividades']))
                    {
                            $model->attributes=$_POST['Actividades'];

                            if($model->save(false)){
                                
                                $criteria = new CDbCriteria;
                                $criteria->select = 'id_actividades, name'; 
                                $criteria->addCondition('proceso_id ='.$id_proceso);

                                $actividades = CHtml::listData(Actividades::model()->findAll($criteria), 'id_actividades', 'name');
  
                                echo CJSON::encode($actividades); //DATA I WANT TO PASS TO FORM
                                                

                                 EQuickDlgs::checkDialogJsScript(-------- ? ----------);

                            }

                    }   
    
                        EQuickDlgs::render('_create',array('model'=>$model));

	 }else
			throw new CHttpException(400,'Accion invalida. No la intente de nuevo.'); 
                    
                    
         }
                




I tried:


 EQuickDlgs::checkDialogJsScript("
                                    window.parent.$('#Interacciones_actividad_id').val(data);  
     
                                ");



But i get : "data is not defined" firebug msg.

Ty, for your answer.
0

#30 User is offline   dan2001x 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 10-June 13

Posted 01 July 2013 - 02:17 AM

View PostCait, on 13 April 2013 - 01:26 AM, said:

That EQuickDlgs::checkDialogJsScript($customJsScript); method is in Controller itself.

How could i pass some $data = array(...) from that controller to that $customJsScript ?

I need to update a form dropdown like this:


FORM:

 <?php echo $form->dropDownListRow($model, 'actividad_id',$actividades, 
                                   array(
                                       'style'=>'width:100%;',
                                       'empty'=>'Seleccione Actividad',
                                       'errorOptions'=>array('style'=>'display:none;'),  
                                       'labelOptions'=>array('style'=>'display:none;')
                                   )); ?>
         
                    <?php EQuickDlgs::iframeButton(
                                array(
                                    'controllerRoute' => '/actividades/ajaxCreateFromInteraccion',
                                    'urlParams'=>array('id_proceso'=>$id_proceso, 'ajaxRequest'=>1),
                                    'hideTitleBar' => true,
                                    'dialogTitle' => 'Crear nueva actividad',
                                    'dialogWidth' => 550, 
                                    'dialogHeight' => 335,
                                    'openButtonText' => 'Nueva Actividad',
                                    'closeButtonText' => 'Cerrar',
                                    'closeOnAction' => true, //important to invoke the close action in the 
          
                                ) 
                            );
                   ?>
 
CONTROLLER ACTION:

  public function actionAjaxCreateFromInteraccion($id_proceso=null)
	{
              if(isset($_GET['ajaxRequest']) && $_GET['ajaxRequest']== 1){
                  
                    $model=new Actividades;
                    $model->proceso_id = $id_proceso;

                    if(isset($_POST['Actividades']))
                    {
                            $model->attributes=$_POST['Actividades'];

                            if($model->save(false)){
                                
                                $criteria = new CDbCriteria;
                                $criteria->select = 'id_actividades, name'; 
                                $criteria->addCondition('proceso_id ='.$id_proceso);

                                $actividades = CHtml::listData(Actividades::model()->findAll($criteria), 'id_actividades', 'name');
  
                                echo CJSON::encode($actividades); //DATA I WANT TO PASS TO FORM
                                                

                                 EQuickDlgs::checkDialogJsScript(-------- ? ----------);

                            }

                    }   
    
                        EQuickDlgs::render('_create',array('model'=>$model));

	 }else
			throw new CHttpException(400,'Accion invalida. No la intente de nuevo.'); 
                    
                    
         }
                




I tried:


 EQuickDlgs::checkDialogJsScript("
                                    window.parent.$('#Interacciones_actividad_id').val(data);  
     
                                ");



But i get : "data is not defined" firebug msg.

Ty, for your answer.


If you didn't already solved your problem...
You don't need to refresh the entire dropdownlist just add the newly added row to it using jquery.
$seleNew= CHtml::tag('option',array ('value'=>$model->id, 'selected'=>true),CHtml::encode($model->name),true);
$customJsScript = "window.parent.$('#YOURSDROPDOWNLISTID').append('".$seleNew."');";
EQuickDlgs::checkDialogJsScript($customJsScript);

0

Share this topic:


  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users