d.bernaert Posted October 9, 2019 Share Posted October 9, 2019 Hello, I want to prevent the complete expansion of a unidbtreegrid when adding a subitem. How could that be done? I add a record to the dataset and just do a post. Thx, Dominique Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 9, 2019 Share Posted October 9, 2019 19 minutes ago, d.bernaert said: I want to prevent the complete expansion of a unidbtreegrid when adding a subitem. How could that be done? I add a record to the dataset and just do a post. Hello Dominique, If possible, can you make a simple testcase for reproduce? Quote Link to comment Share on other sites More sharing options...
d.bernaert Posted October 9, 2019 Author Share Posted October 9, 2019 Okay, will do with a memory dataset? Dominique Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 9, 2019 Share Posted October 9, 2019 1 minute ago, d.bernaert said: will do with a memory dataset? OK. Quote Link to comment Share on other sites More sharing options...
d.bernaert Posted October 10, 2019 Author Share Posted October 10, 2019 Hi, I've created a small sample application. It's not quite the same problem but it shows what I want. In this case, there are subtitles in the second title and in the third title. Click on the second title and add a subtitle to the second title. You will see that the complete tree view will be collapsed. I want the second title to remain expanded and the new subtitle selected. I also don't want the third title to be expanded when adding a subtitle to the second title. Thx, Dominique TestTreeview.zip Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 10, 2019 Share Posted October 10, 2019 8 minutes ago, d.bernaert said: I've created a small sample application. Hi Dominique, Thanks for the testcase. I will check. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 11, 2019 Share Posted October 11, 2019 On 10/10/2019 at 2:13 PM, d.bernaert said: TestTreeview.zip Hello Dominique, Sorry for the late reply. Can you try to use 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 (node && node.data && this.grid.expandedNodes && this.grid.expandedNodes.indexOf(node.data.id)!=-1) { if (node.parentNode && node.parentNode.data.expanded) { node.expand() } else if (node.parentNode) { node.parentNode.expand() } }; } Quote Link to comment Share on other sites More sharing options...
SISBLU Software Posted November 27, 2019 Share Posted November 27, 2019 Not work Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 27, 2019 Share Posted November 27, 2019 14 minutes ago, Daha Software said: Not work Make a simple testcase for check. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.