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!
Page 1 of 1
Using Cjuidatepicker For Cgridview Filter
#2
Posted 03 November 2012 - 12:06 PM
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
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'})}",
#4
Posted 16 November 2012 - 03:58 AM
sanjay1024, on 03 November 2012 - 12:06 PM, said:
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
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'})}",
where should I place the code? Im a newbie, sorry. Thanks!
#5
Posted 17 November 2012 - 06:24 AM
Neil Bardos, on 16 November 2012 - 03:58 AM, said:
where should I place the code? Im a newbie, sorry. Thanks!
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!
Share this topic:
Page 1 of 1

Help











