dhx.List scroll to specific item


#1

Hi, there is a way to scroll into specific item in dhx.List control?
I have not found any way

Regards


#2

I believe the ‘Scroll’ according to specified coordinates is only on the TreeGrid and Grid. However, with the new updates … there might be hope.


#3

By the way, I find the dhx.Grid to be very robust and very versatile which means it can be made to look like a list but still give you all the functionality you may be looking for. Drop the header and footer and you pretty much have a list. Then you also have the scroll capability. Just a thought …


#4

Hello Michele.

The problem is confirmed. There is a setFocus() method that selects an item and should scroll the view to this item, but now it does not scroll the view. We’ll try to fix it in one of the future updates.


#5

Hello,
i have solved with the following code:

const id =list.data.getId(list.data.getLength() - 1); // Or any other element
document.querySelector(‘li[dhx_id="’ + id + ‘"]’).scrollIntoView();

Thanks for your support


#6

We have fixed the problem with the setFocus() method in the dhx.Suite 7.2.1. update:


Now it scrolls to the specified item correctly.