@@ -93,8 +93,8 @@ public function init()
93
93
{
94
94
parent ::init ();
95
95
96
- if (isset ($ this ->options ['id ' ])) {
97
- $ this ->setId ( $ this -> options ['id ' ]) ;
96
+ if (! isset ($ this ->options ['id ' ])) {
97
+ $ this ->options ['id ' ] = $ this -> id ;
98
98
}
99
99
$ this ->registerTranslations ();
100
100
$ this ->initDefaultElements ();
@@ -158,7 +158,7 @@ protected function initDefaultElements()
158
158
$ this ->elements ['bulk-actions ' ] = Html::dropDownList ('bulkactions ' , null , $ this ->bulkActionsItems ,
159
159
ArrayHelper::merge ([
160
160
'prompt ' => $ this ->bulkActionsPrompt ,
161
- 'id ' => ' bulk-actions ' ,
161
+ 'id ' => $ this -> _bulkActionsId ,
162
162
'disabled ' => $ this ->grid === null ,
163
163
], $ this ->bulkActionsOptions )
164
164
);
@@ -177,7 +177,7 @@ protected function initDefaultElements()
177
177
*/
178
178
public function run ()
179
179
{
180
- echo Html::beginTag ('div ' , ArrayHelper:: merge ([ ' id ' => $ this ->id ], $ this -> options ) ) . "\n" ;
180
+ echo Html::beginTag ('div ' , $ this ->options ) . "\n" ;
181
181
echo $ this ->renderContainer ? Html::beginTag ('div ' , $ this ->containerOptions ) . "\n" : '' ;
182
182
foreach ($ this ->templates as $ template => $ options ) {
183
183
if (!is_array ($ options )) {
@@ -208,7 +208,8 @@ protected function renderElements($template)
208
208
$ name = $ matches [1 ];
209
209
if (isset ($ this ->elements [$ name ])) {
210
210
if ($ name === 'bulk-actions ' && $ this ->grid !== null ) {
211
- $ this ->view ->registerJs ("$('# {$ this ->id } # {$ this ->_bulkActionsId }').change(function() {
211
+ $ id = $ this ->options ['id ' ];
212
+ $ this ->view ->registerJs ("$('# {$ id } # {$ this ->_bulkActionsId }').change(function() {
212
213
if (this.value) {
213
214
var ids = $('# {$ this ->grid }').yiiGridView('getSelectedRows'),
214
215
dataConfirm = this.options[this.selectedIndex].getAttribute('data-confirm'),
0 commit comments