Jump to content

Recommended Posts

Posted
On 11/5/2018 at 6:42 PM, Freeman35 said:

I wanna after open dataset, Collaps all group

Hello,

One of the possible solution I think

1. CustomCSS:

.x-grid-group-hd-collapsed .x-grid-group-title {
    background-image: none;
}

2. UniDBGrid1 -> OnAfterLoad event:

procedure TMainForm.UniDBGrid1AfterLoad(Sender: TUniDBGrid);
begin
  UniDBGrid1.JSInterface.JSCall('view.features[0].collapseAll', []);
end;

 

  • Like 1
  • 4 years later...
Posted
2 hours ago, Sherzod said:

Hello,

What are your grid settings?

Hi,

dbgrid-> grouping -> collapsible, summary -> grandtotal

Just normal dbgrid with grouping and summary.

Thanks,

Frances

Posted
47 minutes ago, Sherzod said:

Isn't everything expanded by default?

Hi,

Yes all expanded.. I copied the code above to collapsed and it did.

i just want to expand the first group by code.

 

Posted
1 hour ago, fraxzi said:

i just want to expand the first group by code.

Okay, you can try to use this approach:

1. UniDBGrid1.ClientEvents.UniEvents ->

function afterCreate(sender) 
{
    sender.expandFirstGroup = function() {
        try {
            sender.getView().features[0].expand(sender.getView().features[0].dataSource.data.items[0].groupKey)
        } catch (err) {}
    }
}

2. Usage:

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  UniDBGrid1.JSInterface.JSCall('expandFirstGroup', []);
end;

 

Posted
On 9/29/2023 at 2:56 PM, Sherzod said:

Okay, you can try to use this approach:

1. UniDBGrid1.ClientEvents.UniEvents ->

function afterCreate(sender) 
{
    sender.expandFirstGroup = function() {
        try {
            sender.getView().features[0].expand(sender.getView().features[0].dataSource.data.items[0].groupKey)
        } catch (err) {}
    }
}

2. Usage:

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  UniDBGrid1.JSInterface.JSCall('expandFirstGroup', []);
end;

 

Yes!!! @Sherzod, works like a charm!  Thanks much..

 

  • Thanks 1

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