igniteui-angular icon indicating copy to clipboard operation
igniteui-angular copied to clipboard

Internet Explorer remote service calls called multiple times

Open prabakaran1311 opened this issue 7 years ago • 4 comments

Description

I have integrated #4299 with my application after but after integrated i got one issue in filter. i have implemented remote paging sorting filtering all are remote api calls. initially when i clicking on filtering textbox automatically service calls are called two times without start typing. I am getting this issue in Internet explorer only. in chrome working fine. i have attached screenshot for example. calls

Below is my sample code: component.html

<igx-tree-grid #grid1 [data]="datas| async" childDataKey="Properties"  [exportExcel]="true"  [paging]="true"  [perPage]="pageSize" [allowFiltering]="true" [height]="null"
                           [showToolbar]="true" [columnHiding]="true" [autoGenerate]="false" [toolbarTitle]="GridName" expansionDepth="0" [displayDensity]="'compact'"
                           (onDataPreLoad)="processData()" (onSortingDone)="processData()" (onFilteringDone)="processData()">
    <igx-column></igx-column>
</igx-tree-grid>

component.ts

public processData() {
        if (this._prevRequest) {
            this._prevRequest.unsubscribe();
        }
        this.spinnerLoading = true;
        this.cdr.detectChanges();
        this.filteringExpr = this.grid1.filteringExpressionsTree.filteringOperands;
        this.sortingExpr = this.grid1.sortingExpressions[0];
        this._prevRequest = this.dataservice.getData(this.gridTypes, parseInt(this.regionID), this.SelecteddealType, this.savedQuery, this.skip, this.top, this.filteringExpr, this.sortingExpr, this.searchExpr)
            .subscribe(data => {
                this.data= data;
                this.dataservice.data.next(data.Records);
                this.totalCount = this.pageCountDetails;
                this.paginate(0, true);
                this.cdr.detectChanges();
            });
    }

i have used the below sample for remote pagination and sorting and filtering https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid/paging.html#remote-data - remote pagination https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid/virtualization.html#remote-sortingfiltering-virtualization - remote filtering and sorting.

prabakaran1311 avatar Apr 15 '19 13:04 prabakaran1311

I assume this is with version 7.2.5.

kdinev avatar Apr 15 '19 14:04 kdinev

Btw, I'm noticing the following thing in your code:

You're calling this.cdr.detectChanges(); twice, even though your operation is async. Does this not display properly without the two manual detect changes calls?

kdinev avatar Apr 15 '19 14:04 kdinev

@prabakaran1311, The issue you are experiencing is caused by a bug in IE11 that the input event is fired when focusing an input with a placeholder. Although MS claims it is fixed, it is still reproducible.

I have tried to workaround the issue in the 'Retemplating filter cell' sample by adding keyup and keydown listeners in order to track if a key is pressed when the input event is fired. Here is the stackblitz demo https://stackblitz.com/edit/angular-3ran3h.

DiyanDimitrov avatar Apr 17 '19 07:04 DiyanDimitrov

@DiyanDimitrov thanks for your solution its working fine...

prabakaran1311 avatar Apr 26 '19 07:04 prabakaran1311