Jump to content

Summary Rows in UniDBTreeGrid


jrp

Recommended Posts

  • 2 weeks later...

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

Link to comment
Share on other sites

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?

image.png.6b5d2063c3f1b6b8093870eedb98e617.png

Link to comment
Share on other sites

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();
}

 

  • Like 1
Link to comment
Share on other sites

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();
}

 

 

Link to comment
Share on other sites

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