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...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...