Event when we use infinite scrolling

hi can you tell me that which  event I should use for when we scroll data in treegrid in angular and we are using infinite scroll in that. 


3 Replies

FS Farveen Sulthana Thameeztheen Basha Syncfusion Team August 25, 2022 02:43 PM UTC


Hi Ayush,


Query#:- which  event I should use for when we scroll data in treegrid in angular and we are using infinite scroll in that.


On performing Infinite Scroll, we suggest to use actionBegin event of the TreeGrid. It will trigger on performing Infinite scroll and we can get the details from the args.


Code example:-

App.Component.html:-

 

<ejs-treegrid

        #treegrid

    [dataSource] = "vData"

    [enableInfiniteScrolling] = "true"

    childMapping = "Crew"

    [treeColumnIndex] = "1"

      (actionBegin) = "actionBegin($event)"

    height = "400"

    [pageSettings] = "pageSettings"

        >

        <e-columns>

              .   .    .

        </e-columns>

  </ejs-treegrid >

 

App.Component.ts:-

 

    actionBegin(args) {

        if (args.requestType == 'infiniteScroll') {

            console.log(args);

        }

    }


Demo link:- https://stackblitz.com/edit/angular-xyazlp?file=app.component.html,app.component.ts

Screenshot:-


Please get back to us if you need any further assistance.


Regards,

Farveen sulthana T



AY Ayush August 30, 2022 09:52 AM UTC

hi farveen 

Hi I got your solution but I want it should work on only when that event is called but now it is working when ever I scroll down. but I want that whenever I click on that event that time only it should show . if we are scrolling down without clicking that event it should not work even if we are going down.



FS Farveen Sulthana Thameeztheen Basha Syncfusion Team August 31, 2022 01:25 PM UTC

Hi Ayush,


The actionBegin event will triggers when requestType as infiniteScroll. If you want this event to be trigger on specific scenario alone, you can trigger based on condition in that event. You can customize according to your requirement on scrolling to trigger the actionBegin event.


Please get back to us if you need any further assistance.


Regards,
Farveen sulthana T


Loader.
Up arrow icon