ng-multiselect-dropdown icon indicating copy to clipboard operation
ng-multiselect-dropdown copied to clipboard

unable to bind new data fetched from api on onFilterChange event.

Open dipaliwagh30 opened this issue 3 years ago • 5 comments

I'm not able to bind new data fetched from api on onFilterChange event. my requirement is, I want to bind 1st 100 records and if search string does not match with any record out of 100, I want to bind next 100 records from api. but this is not happening. please help me with this scenario. template code: <ng-multiselect-dropdown [data]="entity" (onFilterChange)="onFilterChange($event)">

onFilterChange(searchText: string) {
    this.http.getData(searchText).subscribe(data=> this.entity=data);
  }

Originally posted by @NileshPatel17 in https://github.com/NileshPatel17/ng-multiselect-dropdown/issues/185#issuecomment-559960468

dipaliwagh30 avatar Jan 20 '22 17:01 dipaliwagh30

@dipaliwagh30 here is the solution. Not sure if i understood your use case correctly. Its bit unusual use case. let me know what do you think..

https://codesandbox.io/s/v0-3-8-1vkmo?file=/src/app/app.component.ts

You need to clear search text manually to see binded new items.

NileshPatel17 avatar Jan 26 '22 18:01 NileshPatel17

here is the preview.

https://user-images.githubusercontent.com/27020381/151221075-c7b84cde-d70a-41dc-b015-da4682e76330.mp4

NileshPatel17 avatar Jan 26 '22 18:01 NileshPatel17

@NileshPatel17 , it worked for me. just one more use case I need.

is there any way where we can fire a scrollToEnd event when scrollbar touches at the end of list and fire some event. if there is any solution for this, could you please help me with that.

dipaliwagh30 avatar Feb 08 '22 09:02 dipaliwagh30

Thank you so much for replying on the issue I reported. :)

dipaliwagh30 avatar Feb 08 '22 09:02 dipaliwagh30

@NileshPatel17 , it worked for me. just one more use case I need.

is there any way where we can fire a scrollToEnd event when scrollbar touches at the end of list and fire some event. if there is any solution for this, could you please help me with that.

@dipaliwagh30 There is no such event to handle it as of now.

NileshPatel17 avatar Feb 08 '22 11:02 NileshPatel17