File tree 1 file changed +26
-19
lines changed
1 file changed +26
-19
lines changed Original file line number Diff line number Diff line change @@ -204,25 +204,32 @@ document.addEventListener('change', function(e) {
204
204
205
205
206
206
window . datagridSerializeUrl = function ( obj , prefix ) {
207
- var str = [ ] ;
208
- for ( var p in obj ) {
209
- if ( obj . hasOwnProperty ( p ) ) {
210
- var k = prefix ? prefix + "[" + p + "]" : p , v = obj [ p ] ;
211
- if ( v !== null && v !== "" ) {
212
- if ( typeof v == "object" ) {
213
- var r = window . datagridSerializeUrl ( v , k ) ;
214
- if ( r ) {
215
- str . push ( r ) ;
216
- }
217
- } else {
218
- str . push ( encodeURIComponent ( k ) + "=" + encodeURIComponent ( v ) ) ;
219
- }
220
- }
221
- }
222
- }
223
- return str . join ( "&" ) ;
224
- }
225
- ;
207
+ var str = [ ] ;
208
+ let urlPathForPersistentChecking = window . location . pathname ;
209
+
210
+ for ( var p in obj ) {
211
+ if ( obj . hasOwnProperty ( p ) ) {
212
+ var k = prefix ? prefix + "[" + p + "]" : p , v = obj [ p ] ;
213
+ if ( v !== null && v !== "" ) {
214
+ // fix for persistent nette parameters
215
+ if ( urlPathForPersistentChecking . includes ( '/' + v ) ) {
216
+ urlPathForPersistentChecking = urlPathForPersistentChecking . replace ( '/' + v , '' ) ;
217
+ continue ;
218
+ }
219
+ if ( typeof v == "object" ) {
220
+ var r = window . datagridSerializeUrl ( v , k ) ;
221
+ if ( r ) {
222
+ str . push ( r ) ;
223
+ }
224
+ } else {
225
+ str . push ( encodeURIComponent ( k ) + "=" + encodeURIComponent ( v ) ) ;
226
+ }
227
+ }
228
+ }
229
+ }
230
+
231
+ return str . join ( "&" ) ;
232
+ } ;
226
233
227
234
datagridSortable = function ( ) {
228
235
if ( typeof $ . fn . sortable === 'undefined' ) {
You can’t perform that action at this time.
0 commit comments