Scroll datatable row into view

Hi

In a datatable, I want to scroll a specific row into view. For this there is showItem(id) method of datatable.

But it does not seem to work. I get no error, but the item is not scrolled into view. And if I use a non-existing id, it will give me an error.

Is this a bug?

I’m using Webix 3.3.2.

Yep, when you are using the datacollection as source of data, there is no real data loading, so ready is not triggered ( I think it is a bug and need to be fixed )

You can use a bit different approach, wait for data loading in the source dataCollection and select the row in the component after that.

http://webix.com/snippet/43cff47f

The snippet works as expected.
It still does not work in my application, built using webix Jet and containing at present 4 datatables.

I cannot reproduce it in a snippet, sadly :-/

Now I managed to come up with a snippet:

http://webix.com/snippet/ca733717

My app uses webix.DataCollection as source for the datatable (as suggested when using webix JET).

Hi,

Can you provide a snippet of the issue? As far as I can see, all works well:

http://webix.com/snippet/363431bd

Also, you can try the scrollTo method as shown in the above snippet.

Thanks for the explanation.

But in my specific code, I am doing the .select() from inside an onFocus()-handler.

I have an onBlur-handler that records the selected row of the datatable, and then the onFocus-handler should re-select this row the next time this datatable gets focus. But the .select() does nothing. If I insert a console.log()-statement just before the .select(), this message is printed. But the selected row is not scrolled into view.
(My app has several datatables that can be selected from different tabs)

-mads