فهرست منبع

fixed TableAjax url encode for filter with %

Piotr Labudda 8 سال پیش
والد
کامیت
0218b7dfa2
1فایلهای تغییر یافته به همراه8 افزوده شده و 8 حذف شده
  1. 8 8
      SE/se-lib/TableAjax.php

+ 8 - 8
SE/se-lib/TableAjax.php

@@ -2132,27 +2132,27 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
 			if (Object.keys(_state.filters.filterCols).length > 0) {
 				$.each(_state.filters.filterCols, function(col, colProps) {
 					if (colProps.filter && colProps.filter.length > 0) {
-						initUrlAdd += '&f_' + col + '=' + colProps.filter;
+						initUrlAdd += '&f_' + col + '=' + encodeURIComponent(colProps.filter);
 						filtersInitSet = true;
 					}
 				});
 			}
 			$.each(_state.specialFilters, function(groupName, btnValue) {
 				if (btnValue.length > 0) {
-					initUrlAdd += '&sf_' + groupName + '=' + btnValue;
+					initUrlAdd += '&sf_' + groupName + '=' + encodeURIComponent(btnValue);
 					filtersInitSet = true;
 				}
 			});
 
 			if (priv.options.forceFilterInit) {
 				$.map(priv.options.forceFilterInit, function(fltrProps, fltr) {
-					initUrlAdd += '&f_' + fltr + '=' + fltrProps;
+					initUrlAdd += '&f_' + fltr + '=' + encodeURIComponent(fltrProps);
 					filtersInitSet = true;
 				});
 			}
 
 			// p5UI__notifyAjaxCallback({type: 'info', msg: 'pobieranie danych (init) ...'});
-			fetch(priv.options.url + initUrlAdd, {
+			window.fetch(priv.options.url + initUrlAdd, {
 			  method: priv.options.urlPost ? 'POST' : 'GET',
 				credentials: 'same-origin',// add cookies
 			}).then(function (response) {
@@ -2870,7 +2870,7 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
 				_state._modelColFilter.saveBtn.on('click', priv.modelColFilter_saveBtnClicked)
 
 				if (priv.options.userTableFilterUrl) {
-					fetch(priv.options.userTableFilterUrl, {
+					window.fetch(priv.options.userTableFilterUrl, {
 						method: 'POST',
 						headers: {
 							'Content-Type': 'application/json'
@@ -2908,7 +2908,7 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
 			e.stopPropagation()
 			var filtrName = $(this).data('col_filter')
 			if (!filtrName) return
-			fetch('<?= Request::getPathUri() . "index.php?_route=ViewTableAjax&_task=rmUserTableFilterAjax" ?>', {
+			window.fetch('<?= Request::getPathUri() . "index.php?_route=ViewTableAjax&_task=rmUserTableFilterAjax" ?>', {
 				method: 'POST',
 				headers: {
 					'Content-Type': 'application/json'
@@ -2958,7 +2958,7 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
 					return new Promise(function(resolve, reject) {
 						if (!filtrName) reject('Proszę podać nazwę filtra')
 						if (filtrName.length > 255) reject('Nazwa za długa')
-						fetch('<?= Request::getPathUri() . "index.php?_route=ViewTableAjax&_task=addUserTableFilterAjax" ?>', {
+						window.fetch('<?= Request::getPathUri() . "index.php?_route=ViewTableAjax&_task=addUserTableFilterAjax" ?>', {
 							method: 'POST',
 							headers: {
 								'Content-Type': 'application/json'
@@ -3426,7 +3426,7 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
 			_uiNode$Table.parent().parent().addClass('AjaxTable-loading');
 
 			// p5UI__notifyAjaxCallback({type: 'info', msg: 'pobieranie danych...'});
-			fetch(priv.options.url + urlAdd, {
+			window.fetch(priv.options.url + urlAdd, {
 			  method: priv.options.urlPost ? 'POST' : 'GET',
 				credentials: 'same-origin',// add cookies
 			}).then(function (response) {