Combobox can not recycle popup by Filtering

html:
<ejs-combobox #combobox
                                  id='comboboxid'
                                  [dataSource]="datas"
                                  [fields]="fields"
                                  [attr.maxlength]='16'
                                  [showClearButton]='true'
                                  [(value)]='value'
                                  [enabled]="true"
                                  [readonly]="false"
                                  [enablePersistence]="true"
                                  [allowFiltering]='true'
                                  (filtering)='onFiltering($event)'
                                  (beforeOpen)='onbeforeOpen($event)'>

                        <ng-template #itemTemplate let-data>
                            <div class="div">
                                <div class="first">{{data['VoucherNo']}}</div>
                            </div>
                        </ng-template>
                    </ejs-combobox>

When input the value, it will call onFiltering:

    public onFiltering: EmitType<object> = (e: FilteringEventArgs) => {
        this.value = e.text;

        this.controlDataService.getdatalist(40010, 0, '', this.filterManager, 'VoucherNo', "", this.buildFilter(this.value), 1).subscribe((data: any) => {         
            if (data != undefined && data.List) {
                this.datas = JSON.parse(data.List);               
                e.updateData(this.datas);
                this.combobox.dataBind();
            }            
        })
    };

the popup cannot hide



Error:
TypeError: Cannot read property 'querySelector' of null
    at FormBase.hidePopup (:8100/vendor.js:164242)
    at FormBase.onDocumentClick (:8100/vendor.js:158692)
    at ZoneDelegate.invokeTask (:8100/polyfills.js:3505)
    at Object.onInvokeTask (:8100/vendor.js:75769)
    at ZoneDelegate.invokeTask (:8100/polyfills.js:3504)
    at Zone.runTask (:8100/polyfills.js:3273)
    at ZoneTask.invokeTask [as invoke] (:8100/polyfills.js:3586)
    at invokeTask (:8100/polyfills.js:4727)
    at HTMLDocument.globalZoneAwareCallback (:8100/polyfills.js:4764)


Attachment: home_393108c.zip

4 Replies 1 reply marked as answer

PM Ponmani Murugaiyan Syncfusion Team October 17, 2020 08:55 AM UTC

Hi Wills, 

Thanks for contacting Syncfusion support. 

Based on your provided code snippet, we have prepared sample and ensured in our end. But unfortunately the reported error is not replicated in our end. Here we have attached the ensured sample with video demonstration for your reference. 

 
 
 
Kindly check with the above sample and video. If issue still exists in your end please try to replicate the issue in the provided sample. 

Regards, 
Ponmani M 



PG Pon Geetha A J Syncfusion Team October 19, 2020 03:57 AM UTC

To: Syncfusion Support <[email protected]>
Subject: Re: Syncfusion support community forum 158640, Combobox can not recycle popup by Filtering, has been updated. 

hi  
please notes  

In FilteringEvent, 
you must use asynchronous to get data. 

 this.controlDataService.getdatalist(40010, 0, '', this.filterManager, 'VoucherNo', "", this.buildFilter(this.value), 1).subscribe((data: any) => {          
            if (data != undefined && data.List) { 
                this.datas = JSON.parse(data.List);                
                e.updateData(this.datas); 
                this.combobox.dataBind(); 
            }             
        }) 
    }; 



WI wills October 19, 2020 05:43 AM UTC

hi :
please notes:

In FilteringEvent,
you must use asynchronous to get data.

 this.controlDataService.getdatalist(40010, 0, '', this.filterManager, 'VoucherNo', "", this.buildFilter(this.value), 1).subscribe((data: any) => {         
            if (data != undefined && data.List) {
                this.datas = JSON.parse(data.List);               
                e.updateData(this.datas);
                this.combobox.dataBind();
            }            
        })
    };


PM Ponmani Murugaiyan Syncfusion Team October 28, 2020 04:00 PM UTC

Hi wills, 

Thanks for the patience. 

We have checked with the reported query using the asynchronous to get data in filtering event. It is working as expected in our end, please find the test sample below for reference. 

public onFiltering(args: any): void { 
    args.preventDefaultAction = true; 
    let query: Query = new Query(); 
    query = args.text !== "" ? query.where("Game", "startswith", args.text, true) : query; 
    let data = this.dataService.fetch(args.text).subscribe(result => { 
      args.updateData(result, query); 
    }); 
  } 

 


Kindly check with above sample meets your requirement. Please get back us if you need further assistance. 

Regards, 
Ponmnai M 


Marked as answer
Loader.
Up arrow icon