@@ -763,6 +763,7 @@ define([
763
763
764
764
on ( _row , 'remove' , ( evt ) => {
765
765
this . _Searches [ evt . idx ] . destroyRecursive ( )
766
+ delete this . _Searches [ evt . idx ] ;
766
767
} )
767
768
on ( _row , 'create' , lang . hitch ( this , 'createAdvancedSearchRow' ) )
768
769
this . _Searches [ this . _SearchesIdx ] = _row
@@ -804,12 +805,13 @@ define([
804
805
// TODO: implement this and trigger when context has changed
805
806
} ,
806
807
buildFilterQueryFromAdvancedSearch : function ( ) {
808
+ this . _filter = { } ;
807
809
Object . keys ( this . _Searches ) . map ( ( idx ) => {
808
810
const col = this . _Searches [ idx ]
809
811
const condition = col . getValues ( )
810
812
let q ;
811
813
if ( condition . type === 'str' ) {
812
- q = `${ condition . op === 'NOT' ? 'ne' : 'eq' } (${ condition . column } ,${ condition . value } )`
814
+ q = `${ condition . op === 'NOT' ? 'ne' : 'eq' } (${ condition . column } ,${ encodeURIComponent ( condition . value ) } )` ;
813
815
} else if ( condition . type === 'date' ) {
814
816
const encode = ( date ) => {
815
817
if ( ! date ) {
@@ -862,7 +864,9 @@ define([
862
864
}
863
865
}
864
866
if ( this . _filter . hasOwnProperty ( condition . column ) ) {
865
- this . _filter [ condition . column ] . push ( q )
867
+ if ( ! this . _filter [ condition . column ] . includes ( q ) ) {
868
+ this . _filter [ condition . column ] . push ( q ) ;
869
+ }
866
870
} else {
867
871
this . _filter [ condition . column ] = [ q ]
868
872
}
0 commit comments