Note that there are some explanatory texts on larger screens.

plurals
  1. POCJUIDatePicker with CGridView doesn't work
    text
    copied!<p>I am trying to include a Datepicker inside the CGridView as follows, the datepicker widget is used within the Grid View.</p> <pre><code>this-&gt;widget('zii.widgets.grid.CGridView', array( 'id'=&gt;'order-grid', 'dataProvider'=&gt;$model-&gt;search(), 'filter'=&gt;$model, 'columns'=&gt;array( 'order_id', 'customer.address.firstname', 'customer.address.lastname', /*array('name' =&gt; 'ordering_date', 'value' =&gt; 'date("M j, Y", $data-&gt;ordering_date)'), */ array('name'=&gt;'ordering_date', 'value'=&gt;'$data-&gt;ordering_date', 'filter'=&gt;$this-&gt;widget('zii.widgets.jui.CJuiDatePicker', array( 'model'=&gt;$model, 'attribute'=&gt;'ordering_date', 'options'=&gt;array( 'showButtonPanel'=&gt;true, 'changeYear'=&gt;true, ) ), true), 'htmlOptions'=&gt;array('width'=&gt;'80','style'=&gt;'text-align:center'), ), array( 'class'=&gt;'CButtonColumn', 'template' =&gt; '{view} {rollback} {receive}{pack} {dispatch}{delivered}', 'htmlOptions'=&gt;array('width'=&gt;'250px'), 'buttons'=&gt;array( 'receive'=&gt;array( 'id'=&gt;'receive', 'name'=&gt;'receive', 'url'=&gt;'$this-&gt;grid-&gt;controller-&gt;createUrl("/shop/order/admin&amp;received=true", array("id"=&gt;$data-&gt;order_id,"asDialog"=&gt;1,"gridId"=&gt;$this-&gt;grid-&gt;id))', 'type'=&gt;'submit', 'imageUrl'=&gt;'/mdg/images/Receive1.png', 'visible'=&gt;'($data-&gt;status=="pending")?true:false;' ), 'pack'=&gt;array( 'id'=&gt;'pack', 'name'=&gt;'pack', 'type'=&gt;'submit', 'url'=&gt;'$this-&gt;grid-&gt;controller-&gt;createUrl("/shop/order/admin&amp;packed=true", array("id"=&gt;$data-&gt;order_id,"asDialog"=&gt;1,"gridId"=&gt;$this-&gt;grid-&gt;id))', 'click'=&gt;'', 'imageUrl'=&gt;'/mdg/images/pack1.png', 'visible'=&gt;'($data-&gt;status=="received")?true:false;' ), 'dispatch'=&gt;array( 'id'=&gt;'dispatch', 'name'=&gt;'dispatch', 'url'=&gt;'$this-&gt;grid-&gt;controller-&gt;createUrl("/shop/order/admin&amp;dispatched=true", array("id"=&gt;$data-&gt;order_id,"asDialog"=&gt;1,"gridId"=&gt;$this-&gt;grid-&gt;id))', 'click'=&gt;'', 'imageUrl'=&gt;'/mdg/images/dispatch.png', 'visible'=&gt;'($data-&gt;status=="packed")?true:false;' ), 'delivered'=&gt;array( 'id'=&gt;'delivered', 'name'=&gt;'delivered', 'url'=&gt;'', 'click'=&gt;'', 'imageUrl'=&gt;'/mdg/images/delivered1.png', 'visible'=&gt;'($data-&gt;status=="dispatched")?true:false;' ), 'rollback'=&gt;array( 'id'=&gt;'rollback', 'name'=&gt;'rollback', 'url'=&gt;'$this-&gt;grid-&gt;controller-&gt;createUrl("/shop/order/admin&amp;rollback=true", array("id"=&gt;$data-&gt;order_id,"asDialog"=&gt;1,"gridId"=&gt;$this-&gt;grid-&gt;id))', 'click'=&gt;'', 'imageUrl'=&gt;'/mdg/images/rollback.jpg', 'visible'=&gt;'($data-&gt;status=="pending")?false:true;' ), ), ), 'status', ), 'afterAjaxUpdate'=&gt;'function(){ jQuery("#'.CHtml::activeId($model, 'ordering_date').'").datepicker({showButtonPanel:true, changeYear:true}); }', </code></pre> <p>)); ?></p> <p>This Code was taken from a suggestion given in the yiiframework forum. But it doesnt do anything. </p> <p>Any idea why that is? Thanks!</p>
 

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