javedboqo
(Javi Hunzai)
1
Hi
I want to call 2 javascript functions on bootstrap.widgets.TbGridView afterAjaxUpdate property.
Yii::import('ext.chosen.Chosen');
$this->widget('bootstrap.widgets.TbGridView', array(
'type'=>'striped bordered condensed',
'dataProvider'=>$model->search(),
'template'=>"{items}{pager}",
'filter'=>$model,
'afterAjaxUpdate' => 'reinstallDatePicker applyChosen',//this not works
...
...
));
Yii::app()->clientScript->registerScript('apply-Chosen', "function applyChosen(id, data) {
$('select.chosen').chosen();
}");
Yii::app()->clientScript->registerScript('re-install-date-picker', "
function reinstallDatePicker(id, data) {
$('#ClientLedger_sdt').datepicker();
}
");
vinod27ece
(Vinod Agarwal)
2
You can call second function in first one.
Yii::import(‘ext.chosen.Chosen’);
$this->widget(‘bootstrap.widgets.TbGridView’, array(
'type'=>'striped bordered condensed',
'dataProvider'=>$model->search(),
'template'=>"{items}{pager}",
'filter'=>$model,
'afterAjaxUpdate' => 'reinstallDatePicker',
…
…
));
Yii::app()->clientScript->registerScript(‘apply-Chosen’, "function applyChosen() {
$('select.chosen').chosen();
}");
Yii::app()->clientScript->registerScript(‘re-install-date-picker’, "
function reinstallDatePicker(id, data)
{
applyChosen();
$('#ClientLedger_sdt').datepicker();
}
");
javedboqo
(Javi Hunzai)
3
Yeah I call other functions in first function. Any way thanks for reply Vinod Agarwal
GSTAR
(Omzy83)
4
Like this:
'afterAjaxUpdate'=>'js:function(id, data){
reinstallDatePicker();
applyChosen();
}',