Fixes #7450: Don't add empty parameters to URL when filtering a grid

This commit is contained in:
Yurii K
2015-02-25 18:17:20 +02:00
committed by Alexander Makarov
parent 78299a3f01
commit aba7710699
2 changed files with 4 additions and 1 deletions

View File

@ -7,6 +7,7 @@ Yii Framework 2 Change Log
- Bug #7529: Fixed `yii\web\Response::sendContentAsFile()` that was broken in 2.0.3 (samdark) - Bug #7529: Fixed `yii\web\Response::sendContentAsFile()` that was broken in 2.0.3 (samdark)
- Bug #7603: Fixed escape characters in `FormatConverter` to work with unicode characters (maddoger, cebe) - Bug #7603: Fixed escape characters in `FormatConverter` to work with unicode characters (maddoger, cebe)
- Enh #6895: Added `ignoreCategories` config option for message command to ignore categories specified (samdark) - Enh #6895: Added `ignoreCategories` config option for message command to ignore categories specified (samdark)
- Enh #7450: Don't add empty parameters to URL when filtering a grid (yurii-github, samdark)
- Enh #7488: Added `StringHelper::explode` to perform explode with trimming and skipping of empty elements (SilverFire, nineinchnick, creocoder, samdark) - Enh #7488: Added `StringHelper::explode` to perform explode with trimming and skipping of empty elements (SilverFire, nineinchnick, creocoder, samdark)
- Enh #7562: `yii help` now lists all sub-commands by default (callmez) - Enh #7562: `yii help` now lists all sub-commands by default (callmez)
- Enh #7571: HTTP status 500 and "An internal server error occurred." are now returned in case there was an exception in layout and `YII_DEBUG` is false (samdark) - Enh #7571: HTTP status 500 and "An internal server error occurred." are now returned in case there was an exception in layout and `YII_DEBUG` is false (samdark)

View File

@ -101,7 +101,9 @@
$grid.find('form.gridview-filter-form').remove(); $grid.find('form.gridview-filter-form').remove();
var $form = $('<form action="' + url + '" method="get" class="gridview-filter-form" style="display:none" data-pjax></form>').appendTo($grid); var $form = $('<form action="' + url + '" method="get" class="gridview-filter-form" style="display:none" data-pjax></form>').appendTo($grid);
$.each(data, function (name, value) { $.each(data, function (name, value) {
if (value !== '') {
$form.append($('<input type="hidden" name="t" value="" />').attr('name', name).val(value)); $form.append($('<input type="hidden" name="t" value="" />').attr('name', name).val(value));
}
}); });
event = $.Event(gridEvents.beforeFilter); event = $.Event(gridEvents.beforeFilter);