Yii Framework Forum: gridview + ajax + renderpartial + datepicker = not working - Yii Framework Forum

Jump to content

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

gridview + ajax + renderpartial + datepicker = not working Rate Topic: -----

#1 User is offline   Pandoras 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 28-July 11

Posted 24 January 2012 - 07:38 PM

Hi,
I'm struggling with a common ajax problem;

Scenario is like this:
I have a CJuitab which uses renderpartial to generate a gridviews in each tab;
each gridview has a button which opens a cjuidialog window;
the contents of this window is generated by an ajax call tied to the button above.
In the window of the dialog I want a datepicker.

My main problem is, that I have to put the datepicker OUTSIDE of the ajax generated content in order for it to work;
How can I integrate the datepicker inside the ajax function so it will show up and function normally.
I've tried several ways: put a renderpartial inside the ajax to generate the datepicker: datepicker shows up, but the localized language reverts to something asian (japanese, korean, or similar), while I initialize it as 'Dutch'. Putting it directly inside the ajaxfunction doesn't work either; the input field shows, but the datepicker is not triggered at all when clicking on the field.

Any ideas how to call a jui datepicker widget from inside an ajaxcall?
0

#2 User is offline   Hikaru Fung 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 03-February 12

Posted 21 February 2012 - 02:24 AM

I'm encountering the same issue. :(
0

#3 User is offline   mikewalen 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 41
  • Joined: 27-August 11
  • Location:Hamilton, New Zealand

Posted 21 February 2012 - 03:47 AM

Try using an iframe in the CJuiDialog rather than a div. Following the notes in this wiki...

CGridView: Update/create records in a CJuiDialog

... I was able to implement fully jQuery and Ajax functionality (including AutoComplete and DatePicker functionality) in the dialog, while also being able to update the grid views outside the dialog.
0

#4 User is offline   ram87 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 12-February 13

Posted 16 March 2013 - 06:20 AM

watch this..! whatever this use this..
<?php echo $form->labelEx($model,'dob'); ?>
            <?php  
            $this->widget('zii.widgets.jui.CJuiDatePicker', array(
            'model' => $model,
            'attribute' => 'dob',
            'options'=>array(
                'dateFormat' => 'dd/mm/yy',                
                'showAnim'=>'fold',
                'changeMonth'=>'true', 
                'changeYear'=>'true',
            ),
            'htmlOptions' => array(
                    'size' => '10',         // textField size
                    'maxlength' => '10',    // textField maxlength
            ),
            ));
            ?>
            <?php echo $form->error($model,'dob'); ?>

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