$colButtons['update'] = array(
'url' => null,
'click' => "function() {
alert('click');
return false;
}",
'htmlOptions'=>array(
'live'=>false
)
);
then when grid ajax loaded multiple times in modal dialog, update button make duplicated requests.
in framework/zii/widgets/grid/CButtonColumn I see
protected function registerClientScript()
{
$js=array();
foreach($this->buttons as $id=>$button)
{
if(isset($button['click']))
{
$function=CJavaScript::encode($button['click']);
$class=preg_replace('/\s+/','.',$button['options']['class']);
$js[]="jQuery(document).on('click','#{$this->grid->id} a.{$class}',$function);";
}
}
if($js!==array())
Yii::app()->getClientScript()->registerScript(__CLASS__.'#'.$this->id, implode("\n",$js));
}
it is always use (document).on … and ignore live parameter ??