Trigger datagrid 2 virtual scrolling

0
On a page we are using the data grid 2 widget set to virtual scrolling (infinite loading). It is set to load 25 items. We use a nanoflow to create a new object in the datagrid and then the nanoflow action (scroll to) to scroll to the latest item after it is added. Now, when you add the 26th item, the scroll to action does not work. This is because it won't load the 26th item until you scroll downward.   Is there a nanoflow or javascript action or other way to trigger the widget to load the next 25 items? Or is the only way to achieve this to scroll the mouse wheel? (or maybe a scroll to end or scroll to end of page function?)
asked
1 answers
0

Is it an option to revert the sort-order of the DataGrid2-datasource?

If not, try to find the DataGrid2 object, set focus on it, trigger the javascript-function. Though this might do it but still no scrolling to be seen:

export async function DataGrid21_ScrollDown() {
	// BEGIN USER CODE
	let wheelEvent = new WheelEvent('wheel', {
		deltaY: 100,
		deltaMode: WheelEvent.DOM_DELTA_PIXEL
	});
	var DG2 = document.querySelector("#mxui_widget_VerticalScrollContainer_0 div.mx-name-dataGrid21 div");
	DG2.dispatchEvent(wheelEvent);
	// END USER CODE
}

Selector works fine, but the event seems not to trigger.

answered