martinirojo
(Martinmeliendrez)
1
Hi!
I followed this example: Post
It works the first time, but if after selecting a date I want to choose another date (clcking on filter textbox), the datepicker is not shown again.
Any ideas? Do I have to add a jQuery such as $(’#my_datepicker_textbox’).click(function(){… to reload?
Thanks!
Hi,
Yes you have to use jquery to load it again
add below code in your admin.php file
replace the datefield with your field
'afterAjaxUpdate'=>"function(){jQuery('#datefield').datepicker({'dateFormat': 'yy-mm-dd'})}",
martinirojo
(Martinmeliendrez)
3
Great! thank you very much!
neilBardos
(Neil Bardos)
4
where should I place the code? Im a newbie, sorry. Thanks!
martinirojo
(Martinmeliendrez)
5
Hi. I’ve used it like this:
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'ticketGridId',
'dataProvider'=>$model->search(),
'filter'=>$model,
'afterAjaxUpdate'=>"function(){
$.datepicker.setDefaults($.datepicker.regional['en']);
$('#datepicker_id').datepicker({'dateFormat': 'yy-mm-dd'});
}",
'columns'=>array(
'idTicket',
...
I hope it helps!