File tree Expand file tree Collapse file tree 4 files changed +17
-3
lines changed Expand file tree Collapse file tree 4 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -5,3 +5,13 @@ Version 1.0.0 July 15, 2014
5
5
---------------------------
6
6
7
7
- Initial release
8
+
9
+ Version 1.1.0 December 09, 2016
10
+ ---------------------------
11
+
12
+ - Request parameter "ids" change support
13
+
14
+ Version 1.1.1 March 10, 2017
15
+ ---------------------------
16
+
17
+ - Added CSRF notice in documentaion
Original file line number Diff line number Diff line change @@ -57,4 +57,4 @@ DeleteMultipleAction Class
57
57
58
58
[ renderTagAttributes() ] :http://www.yiiframework.com/doc-2.0/yii-helpers-basehtml.html#renderTagAttributes()-detail
59
59
[ dropDownList() ] :http://www.yiiframework.com/doc-2.0/yii-helpers-basehtml.html#dropDownList()-detail
60
- [ t() ] :http://www.yiiframework.com/doc-2.0/yii-baseyii.html#t()-detail
60
+ [ t() ] :http://www.yiiframework.com/doc-2.0/yii-baseyii.html#t()-detail
Original file line number Diff line number Diff line change @@ -79,6 +79,9 @@ public function actions()
79
79
80
80
> Tip: For information about properties and methods of the widget, see the bundled ` DOCUMENTATION.md ` .
81
81
82
+ ### CSRF validation
83
+ For enable CSRF validation make sure you have ``` <?= Html::csrfMetaTags() ?> ``` in main layout.
84
+
82
85
Examples
83
86
--------
84
87
Original file line number Diff line number Diff line change @@ -215,7 +215,8 @@ protected function renderElements($template)
215
215
if (this.value) {
216
216
var ids = $('# {$ this ->grid }').yiiGridView('getSelectedRows'),
217
217
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');
219
220
220
221
if (!ids.length) {
221
222
alert(' " . $ this ->t ('widget ' , 'Please select one or more items from the list. ' ) . "');
@@ -232,7 +233,7 @@ protected function renderElements($template)
232
233
form.append('<input type= \"hidden \" name=' + csrfParam + ' value=' + csrfToken + ' />');
233
234
}
234
235
$.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 + ' />');
236
237
});
237
238
form.appendTo('body').submit();
238
239
}
You can’t perform that action at this time.
0 commit comments