Treetable closes opened row after scrolling up

webix.ui({
	view: "button",
  	value: "check",
    click: function(...args) {
    	$$("tree").showItemByIndex(100);
  }
});

webix.ui({
  id: "tree",
  view:"treetable",
  columns:[
    { id:"value", header:"value", template:"{common.treetable()} #value#",width:300}
  ],
  url: {
    $proxy: true,
    load: function(args, options) {
      	console.log(options); 
        let start = options?.start ?? 1; 
        // start += 1;
        console.log((options?.count ?? args.config.datafetch))
      	const res = []; 
      	for (let i = 0; i < (options?.count ?? args.config.datafetch); ++i) {
            let parentId = start + i; 
        	res.push({
                id: `${start+i}`, value: "vals", "open": false,
                "data": [
                    {
                    	id: `${parentId}_1`, 
                    	value: "child",
 
                    },
                    {
                    	id: `${parentId}_2`, 
                    	value: "child",
                    }  
                ] 
            }); 
        };
    	let fin =  { data:res, parent: options?.parent, total_count: 200, pos: options?.start - 1 };
  		return fin;
  	},
    save : function(args) {}
  }, 
  datafetch:2
});

Steps to reproduce:

  1. Click on the button
  2. open the highest row
  3. Scroll up

After scrolling up opened row will be closed. Expected behaviour is that it remains open

Hi @asdfasdfasdf,

Treetable’s dynamic loading passes all fetched data through the parse() method - new rows are added and old ones are not deleted. However, any value present in the incoming response - such as an explicit open property - will override the client-side state, regardless of what the user had previously set.

To prevent this state overwrite, simply remove the open: false key from the data returned by load(). This will default the state to closed, preventing resets when loading new data (see: Code Snippet).

If you are saving data to the server, an alternative approach is to capture the open state using onAfterOpen and onAfterClose event handlers. You can then send requests to the server to update the data with this status: Code Snippet.