This is a migrated thread and some comments may be shown as answers.

DropDownList virtualization skip control?

2 Answers 176 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 23 Jan 2019, 06:14 PM
I'm using DropDownList virtualization (no filtering) and while it works well, I was hoping that there was a configuration that would allow me to control the specificity of the skip requested. Right now, it requests in increments of 1. I would like for it to be more generic such as requesting in increments of 10. E.g., right now if you have a 1,000 items with a page size of 20, the skip value can be anywhere from 1-999. I am considering overriding what is sent to my service as part of onPageChange. However, in order to do this I have a few questions. Let's assume you have a list of 1,000 and the page size of 100. If a user drags the scroller to 50%, what is requested? skip of 500? or split the difference and request 450? This will help me decide how to round out the skip # requested.

2 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 24 Jan 2019, 08:11 AM
Hello, Ryan,

The skip represents the last visible item at the top of the DropDownList.



If you decide the modify the skip parameter in the request, please have in mind that the same skip has to be set to the DropDownList virtual skip property as otherwise incorrect data will be shown:

virtual={{
    total: total,
    pageSize: pageSize,
    skip: this.state.skip
}}

I hope this is helpful.

Regards,
Stefan
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Mo
Top achievements
Rank 1
Iron
answered on 25 Aug 2022, 06:04 PM

Is it possible to do increments higher than 1? This would prevent an API request for every single tick. I attempted to retrieve a # of records and slicing those and if we reach the end, retrieve the next bunch. The scrollbar felt kind of jumpy and it didn't feel as smooth as the example

 

 

I was basing it off this example

https://codesandbox.io/s/blnxlx?file=/app/main.jsx

Konstantin Dikov
Telerik team
commented on 29 Aug 2022, 11:07 AM

Hi Mo,

The "skip" value is calculated based on the position of the scrollbar and this can be seen in the requests in the example that you have shared. For a different behavior you can change the way that "skipRef.current" value is changed while paging (scrolling). The main limitation is that the page onPageChange of the component will fire when the scrollbar changes and will pass the "skip" value for that particular scroll position and I have to say that this is something that can not be changed, except with some custom logic for handling the "skip" value.

Tags
General Discussions
Asked by
Ryan
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Mo
Top achievements
Rank 1
Iron
Share this question
or