File tree Expand file tree Collapse file tree 1 file changed +20
-14
lines changed
Expand file tree Collapse file tree 1 file changed +20
-14
lines changed Original file line number Diff line number Diff line change @@ -347,27 +347,33 @@ document.addEventListener('change', function(e) {
347347 }
348348} ) ;
349349
350-
351350window . datagridSerializeUrl = function ( obj , prefix ) {
352- var str = [ ] ;
353- for ( var p in obj ) {
354- if ( obj . hasOwnProperty ( p ) ) {
355- var k = prefix ? prefix + "[" + p + "]" : p , v = obj [ p ] ;
356- if ( v !== null && v !== "" ) {
357- if ( typeof v == "object" ) {
358- var r = window . datagridSerializeUrl ( v , k ) ;
351+ var str = [ ] ;
352+ let urlPathForPersistentChecking = window . location . pathname ;
353+
354+ for ( var p in obj ) {
355+ if ( obj . hasOwnProperty ( p ) ) {
356+ var k = prefix ? prefix + "[" + p + "]" : p , v = obj [ p ] ;
357+ if ( v !== null && v !== "" ) {
358+ // fix for persistent nette parameters
359+ if ( urlPathForPersistentChecking . includes ( '/' + v ) ) {
360+ urlPathForPersistentChecking = urlPathForPersistentChecking . replace ( '/' + v , '' ) ;
361+ continue ;
362+ }
363+ if ( typeof v == "object" ) {
364+ var r = window . datagridSerializeUrl ( v , k ) ;
359365 if ( r ) {
360366 str . push ( r ) ;
361367 }
362- } else {
363- str . push ( encodeURIComponent ( k ) + "=" + encodeURIComponent ( v ) ) ;
368+ } else {
369+ str . push ( encodeURIComponent ( k ) + "=" + encodeURIComponent ( v ) ) ;
370+ }
364371 }
365372 }
366373 }
367- }
368- return str . join ( "&" ) ;
369- }
370- ;
374+
375+ return str . join ( "&" ) ;
376+ } ;
371377
372378datagridSortable = function ( ) {
373379 if ( typeof $ . fn . sortable === 'undefined' ) {
You can’t perform that action at this time.
0 commit comments