Skip to content

Commit 9d2f9de

Browse files
committed
added get parameter name change support
1 parent 5b4539e commit 9d2f9de

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Widget.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ protected function renderElements($template)
215215
if (this.value) {
216216
var ids = $('#{$this->grid}').yiiGridView('getSelectedRows'),
217217
dataConfirm = this.options[this.selectedIndex].getAttribute('data-confirm'),
218-
url = this.options[this.selectedIndex].getAttribute('url');
218+
opts = this.options[this.selectedIndex],
219+
url = opts.getAttribute('url');
219220
220221
if (!ids.length) {
221222
alert('" . $this->t('widget', 'Please select one or more items from the list.') . "');
@@ -232,7 +233,7 @@ protected function renderElements($template)
232233
form.append('<input type=\"hidden\" name=' + csrfParam + ' value=' + csrfToken + ' />');
233234
}
234235
$.each(ids, function(index, id) {
235-
form.append('<input type=\"hidden\" name=\"ids[]\" value=' + id + ' />');
236+
form.append('<input type=\"hidden\" name=\"' + (opts.getAttribute('name') ? opts.getAttribute('name') : 'ids') + '[]\" value=' + id + ' />');
236237
});
237238
form.appendTo('body').submit();
238239
}

0 commit comments

Comments
 (0)