Note that there are some explanatory texts on larger screens.

plurals
  1. POyii datepicker widget inside an iframe embedded in a fancybox
    primarykey
    data
    text
    <p>Hi I am a total newbie to JS and am trying the following:</p> <p>I am having a Yii application in which there is an ajaxLink that triggers a fancybox. This link renders a view in an iframe inside the fancybox. The rendered view is a form containing Yii zii.widgets.jui.CDatePicker widget. This renders the view and shows the date text field with proper date values. But onclick it doesnt show up the calendar.</p> <p>Code triggering the fancybox:</p> <pre><code>echo CHtml::ajaxLink('Add Entry',Yii::app()-&gt;createUrl('site/myentry', array('action'=&gt;'new')), array('type'=&gt;'GET', 'update'=&gt;'#adexp', 'complete'=&gt;'afterAjax')); </code></pre> <p>js function:</p> <pre><code>function afterAjax() { $.fancybox({ href : '#adexp', scrolling : 'no', transitionIn : 'fade', transitionOut : 'fade', width: 1024, height: 500, autoDimensions: false, onClosed: function() { $('#adexp').html(''); location.reload();}, }); } </code></pre> <p>Rendering the iframe for the form:</p> <pre><code>&lt;iframe src="&lt;?php echo $this-&gt;createUrl('site/entryform', array('UtcRecord'=&gt;$model-&gt;UtcRecord, 'UserId'=&gt;$model-&gt;UserId, 'action'=&gt;$action));?&gt;" style="width: 100%; height:440px;" id="entryform"&gt;&lt;/iframe&gt; </code></pre> <p>and the widget inside this form view:</p> <pre><code>$this-&gt;widget( 'zii.widgets.jui.CJuiDatePicker', array( 'model' =&gt; $model, 'attribute' =&gt; 'EntryTime', 'language'=&gt; 'en', 'options' =&gt; array( 'dateFormat' =&gt; 'dd-mm-yy', 'style'=&gt;'z-index: 5000;', ), ) ); </code></pre> <p>Observation made by Firebug: the input field in the form doesnt have the Datepicker class. If I use the same Yii widget code in a normal page, this class is present in the input tag and the widget works fine. </p> <p>I tried: 1. Increasing the z-index of the datepicker widget to 5000. 2. Including jquery and css manually in iframe head tag since I thought iframe might not be picking up styles and js.</p> <p>Could this be a Yii widgets rendering issue inside an iframe?</p> <p>Would really appreciate any insights on the issue. :-)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload