Yii Framework Forum: Yii syntax to customize position of CJuidialog on screen - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Yii syntax to customize position of CJuidialog on screen What is Yii syntax to customize position of CJuidialog on screen Rate Topic: -----

#1 User is offline   Mutyi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 27
  • Joined: 02-September 11

Posted 03 September 2012 - 09:55 AM

Default position of Cjuidialog is 'center'. I want to change it
to be for example left = 300px, top = 50px.
I have consulted original documentation of JQuery UI but my problem
is that I do not know the right syntax to use in yii.
Here is my code and what I've tryed so far without success.


$this->beginWidget('zii.widgets.jui.CJuiDialog', array(
    'id'=>'PaymentmethodNotAvailable',
    'options'=>array(
    
       'title'=>'Information',
       
        'width'=>475,
        'height'=>225,
        'autoOpen'=>false,
        'resizable'=>true,
        'modal'=>true,
          .
          .
          .

        'position'=>array('left'=>300, 'top'=50), <-- not working

         'left' => 300,  <-- not working either
         'top' => 50,    <-- not working either
          .
          .
          .
        
        'overlay'=>array(
            'backgroundColor'=>'#000',
            'opacity'=>'3.5'
        ),
        'buttons'=>array(
        ),
    ),
));



Any help is highly appreciated.
thxs
0

#2 User is offline   SteveD 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 20
  • Joined: 26-April 12
  • Location:Tucson, Arizona

Posted 13 June 2013 - 01:29 AM

View PostMutyi, on 03 September 2012 - 09:55 AM, said:

Default position of Cjuidialog is 'center'. I want to change it
to be for example left = 300px, top = 50px.
I have consulted original documentation of JQuery UI but my problem
is that I do not know the right syntax to use in yii.


I know this is an old thread, but I found it using Google and someone else with the same question may find it too. So here's the answer. First, for reference read the jQuery UI documentation about the position option.

To translate this into an option for the Yii CJuiDialog widget:

$this->beginWidget('zii.widgets.jui.CJuiDialog',array(

...

    // additional javascript options for the dialog plugin
    'options'=>array(

...

        'position'=>array('my'=>'top','at'=>'top'),
OR
        'position'=>array(300,50),
    ),
));


I hope this helps someone.
0

Share this topic:


Page 1 of 1
  • 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