jrp Posted August 28 Share Posted August 28 Hello, I'm looking at the UniDBTreeGrid example \FMSoft\Framework\uniGUI\Demos\Desktop\Grid - DBTreeGrid How to display some summary in the rows below? Thank you Quote Link to comment Share on other sites More sharing options...
jrp Posted September 11 Author Share Posted September 11 Hello, Somebody could help? The summary could be the sum of the field (if the type of the field is numerical) or maybe anything else. Thank you Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 11 Share Posted September 11 1 hour ago, jrp said: Somebody could help? The summary could be the sum of the field (if the type of the field is numerical) or maybe anything else. Hello, Can you make a testcase for your case, I will try to analyze? Quote Link to comment Share on other sites More sharing options...
jrp Posted September 11 Author Share Posted September 11 Hi Sherzod, I will create a testcase in a day or two, but for now maybe you could have a look at the example above (\FMSoft\Framework\uniGUI\Demos\Desktop\Grid - DBTreeGrid) and use the company column to display the count of entries in each city (for example: Bahamas=4, Belize=1, Bermuda=2, etc). Thank you Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 11 Share Posted September 11 2 hours ago, jrp said: but for now maybe you could have a look at the example above (\FMSoft\Framework\uniGUI\Demos\Desktop\Grid - DBTreeGrid) and use the company column to display the count of entries in each city (for example: Bahamas=4, Belize=1, Bermuda=2, etc). Something like this? Quote Link to comment Share on other sites More sharing options...
jrp Posted September 11 Author Share Posted September 11 3 hours ago, Sherzod said: Something like this? Yes Sherzod, that's it How do you do that? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 12 Share Posted September 12 I will post. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 12 Share Posted September 12 6 hours ago, jrp said: Yes Sherzod, that's it How do you do that? One possible solution: function store.nodeexpand(sender, eOpts) { var store = this; var colIndx = 1; /* Second column */ sender.childNodes.forEach(function(node) { var leafCount = 0; store.getNodeById(node.data.id).cascadeBy(function(_node) { if (_node.isLeaf()) leafCount++; }); if (!node.isLeaf()) node.data[colIndx] = leafCount; }); store.grid.getView().refresh(); } 1 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 12 Share Posted September 12 You can simply adapt this solution for other operations, such as sum... Quote Link to comment Share on other sites More sharing options...
jrp Posted September 12 Author Share Posted September 12 Hi Sherzod, Thank you for the solution. But.. uhm... sorry... where to put the JavaScript function and how to use it? 😅 3 hours ago, Sherzod said: One possible solution: function store.nodeexpand(sender, eOpts) { var store = this; var colIndx = 1; /* Second column */ sender.childNodes.forEach(function(node) { var leafCount = 0; store.getNodeById(node.data.id).cascadeBy(function(_node) { if (_node.isLeaf()) leafCount++; }); if (!node.isLeaf()) node.data[colIndx] = leafCount; }); store.grid.getView().refresh(); } Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 12 Share Posted September 12 1 hour ago, jrp said: where to put the JavaScript function and how to use it? 😅 UniDBTreeGrid.ClientEvents.ExtEvents [store] Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 12 Share Posted September 12 1 Quote Link to comment Share on other sites More sharing options...
jrp Posted September 12 Author Share Posted September 12 Thank you very much Sherzod! I have tried it in the example, it worked 1 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.