Events attaching to buttons in “live” mode cause all sorts of problems if they’re embedded within forms received via AJAX. As far as I understand, there’re two options:
-
set “live” property of “htmlOptions” argument to false;
-
set CHtml::$liveEvents to false.
I’ve chosen the latter and set CHtml::$liveEvents to false in init() of my controller dealing with AJAX requests.
Question. Will setting CHtml::$liveEvents=false cause any problems? Does any code in Yii really depend on it, or is it just optimization for cases of huge numbers of controls, for which “live” mode is way faster?
Also, can it be fixed on the framework level? Single buttons obviously don’t need “live” events, so “live” property can be set to false for them by default.