Jump to content

DBTreeGrid auto collapsed on update


nimarufa

Recommended Posts

Hi, I've got one problem - after update data in TreeGrid the grid is auto collapsed.

I need only update data and keep opened nodes open and closed nodes close.

I'm attaching a sample.

Way to repoduce:

1. Tap "Expand" or open some nodes.

2. Tap Update

The thee will close all nodes automatically.

Please help to solve it.

Version 1.50.0.1480 Complete

Link to comment
Share on other sites

3 hours ago, nimarufa said:

Please, any suggestions....

Can you try this approach ?!

 

UniDBTreeGrid -> ClientEvents ->

1. UniEvents -> function beforeInit:

function beforeInit(sender, config)
{
    sender.expandedNodes=[];
}

2. ExtEvents -> function store.beforeload

function store.beforeload(store, operation, eOpts)
{
    var me=this.grid;
    me.expandedNodes=[]; 
    me.getRootNode().cascadeBy(function(node) {
        if (node.data.expanded) {
            me.expandedNodes.push(node.data.id)
        }
    });
}

3. ExtEvents -> function store.nodeappend

function store.nodeappend(sender, node, index, eOpts)
{
    if (this.grid.expandedNodes && this.grid.expandedNodes.indexOf(node.data.id)!=-1) {
        if (node.parentNode.data.expanded) { 
            node.expand()
        } else {
            node.data.expanded = true
        } 
        
    }
}

 

  • Like 2
Link to comment
Share on other sites

  • 1 year later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...