Jump to content

How to change color in group area if TUniDBGrid.Grouping.Enabled = True


Recommended Posts

Thanks , that is fine
BUT it will change design for ALL grouped grid in application.
 
That is not useful at all.
If it is a single form app ... perfect
but there are a lot of grids (more than one)  in any DB application(you know).

I think that with this ...  all of them will be affected/modified .

It is reasonable (I think) it to be able to customize any particular grid ( if necessary)

 

How could I do this ?
 

Link to post
Share on other sites

Hi,

 

Thanks , that is fine
BUT it will change design for ALL grouped grid in application.
 
That is not useful at all.
If it is a single form app ... perfect
but there are a lot of grids (more than one)  in any DB application(you know).

I think that with this ...  all of them will be affected/modified .

It is reasonable (I think) it to be able to customize any particular grid ( if necessary)

 

How could I do this ?
 

 

1. CustomCSS:

.custom-grid .x-grid-group-hd {
  background-color: yellowgreen;
}

.custom-grid .x-grid-group-title {
  color: black;
}

2. UniDBGrid -> ClientEvents -> UniEvents -> function beforeInit:

function beforeInit(sender, config)
{
    config.cls='custom-grid';
}
Link to post
Share on other sites

Something additional to be completely precisely

One of my grids(grouped) shows requests for delivery of products from set of suppliers.
Products are grouped on screen in orders
Each order have a self live cycle "CREATE"->"REQUSTED"->"DELIVERED"->"COMPLETTE".
Order are ordered by number (desc).
I have a good control of product rows with writing code in OnDrawColumnCell   grid event.
Could I use OnDrawColumnCell for group(order header) row ?

My customers thinks that In this way this grid will become more informative  
 

Link to post
Share on other sites
  • 1 year later...
On 6/21/2018 at 2:35 AM, Sherzod said:

Also in "runtime":

 

 

Add:


<GridObject>.JSInterface.JSCall('addCls', ['custom-grid']);

Remove:


<GridObject>.JSInterface.JSCall('removeCls', ['custom-grid']);

I have the grid grouped and I wanted it to show all the groups collected, how can I do it?

Link to post
Share on other sites

I still do not understand ...

Perhaps you mean this (JS codes):

  //collapseAll
  MainForm.UniDBGrid1.getView().getFeature('grouping').collapseAll();
  //expandAll
  MainForm.UniDBGrid1.getView().getFeature('grouping').expandAll();

 

Link to post
Share on other sites
1 hour ago, Sherzod said:

I still do not understand ...

Perhaps you mean this (JS codes):


  //collapseAll
  MainForm.UniDBGrid1.getView().getFeature('grouping').collapseAll();
  //expandAll
  MainForm.UniDBGrid1.getView().getFeature('grouping').expandAll();

 

Which unit do I need to declare to use this command?
MainForm .UniDBGrid1.getView (). GetFeature ('grouping'). CollapseAll ();

Link to post
Share on other sites
4 minutes ago, eduardosuruagy said:

Which unit do I need to declare to use this command?
MainForm .UniDBGrid1.getView (). GetFeature ('grouping'). CollapseAll ();

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  with UniDBGrid1 do
    if Grouping.Collapsible then
      JSInterface.JSCall('getView().getFeature("grouping").collapseAll', []);
end;

 

Link to post
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...