kkelchev Posted June 20, 2018 Posted June 20, 2018 Hi , If TUniDBGrid.Grouping.Enabled = True Is it posible(how) to change/setup (runtime) background colour under group header row area. Pls, find attached excample picture Thanks Quote
Sherzod Posted June 20, 2018 Posted June 20, 2018 Hi, Are you using a template? Can you make a simple testcase if possible?! Quote
kkelchev Posted June 20, 2018 Author Posted June 20, 2018 HiWhat you mean with "template"I'm with theme "uni_win10" Quote
kkelchev Posted June 20, 2018 Author Posted June 20, 2018 For test case , you could go to: http://prime.fmsoft.net/demo/desktop/mdemo65.dll Demo forGrids:Grouping and sortingThere is grid like this. Question is how to change color with Country name , like i did manualy (picture attached) Quote
Sherzod Posted June 20, 2018 Posted June 20, 2018 One possible solution I think CustomCSS: .x-grid-group-hd { background-color: yellowgreen; } .x-grid-group-title { color: black; } Quote
kkelchev Posted June 20, 2018 Author Posted June 20, 2018 Thanks , that is fineBUT it will change design for ALL grouped grid in application. That is not useful at all.If it is a single form app ... perfectbut 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 ? Quote
Sherzod Posted June 21, 2018 Posted June 21, 2018 Hi, Thanks , that is fineBUT it will change design for ALL grouped grid in application. That is not useful at all.If it is a single form app ... perfectbut 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'; } Quote
kkelchev Posted June 21, 2018 Author Posted June 21, 2018 Could I do this also like this (with code) <GridObject>.JSInterface.JSConfig('cls', ['custom-grid']); Quote
Sherzod Posted June 21, 2018 Posted June 21, 2018 Could I do this also like this (with code) <GridObject>.JSInterface.JSConfig('cls', ['custom-grid']); Yes Quote
Sherzod Posted June 21, 2018 Posted June 21, 2018 Also in "runtime": Add: <GridObject>.JSInterface.JSCall('addCls', ['custom-grid']); Remove: <GridObject>.JSInterface.JSCall('removeCls', ['custom-grid']); Quote
kkelchev Posted June 21, 2018 Author Posted June 21, 2018 Something additional to be completely preciselyOne of my grids(grouped) shows requests for delivery of products from set of suppliers.Products are grouped on screen in ordersEach 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 Quote
eduardosuruagy Posted April 14, 2020 Posted April 14, 2020 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? Quote
Sherzod Posted April 14, 2020 Posted April 14, 2020 1 hour ago, eduardosuruagy said: I have the grid grouped and I wanted it to show all the groups collected, how can I do it? Please explain. Quote
eduardosuruagy Posted April 14, 2020 Posted April 14, 2020 3 minutes ago, Sherzod said: Por favor explique. My grid has the option Grouping.Collapsible: = True; I wanted all the groups on the grid to be minimized as in the photo. Quote
Sherzod Posted April 14, 2020 Posted April 14, 2020 1 minute ago, eduardosuruagy said: My grid has the option Grouping.Collapsible: = True; I wanted all the groups on the grid to be minimized as in the photo. Is it at the beginning? Quote
eduardosuruagy Posted April 14, 2020 Posted April 14, 2020 1 minute ago, Sherzod said: É no começo? This, when opening the form already showed it like this. Quote
Sherzod Posted April 14, 2020 Posted April 14, 2020 2 minutes ago, eduardosuruagy said: This, when opening the form already showed it like this. Do you want to expand all? Quote
eduardosuruagy Posted April 14, 2020 Posted April 14, 2020 1 minute ago, Sherzod said: Deseja expandir tudo? I want to collect everything, not expand Quote
Sherzod Posted April 14, 2020 Posted April 14, 2020 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(); Quote
eduardosuruagy Posted April 14, 2020 Posted April 14, 2020 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 (); Quote
Sherzod Posted April 14, 2020 Posted April 14, 2020 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; Quote
eduardosuruagy Posted April 14, 2020 Posted April 14, 2020 4 minutes ago, Sherzod said: with UniDBGrid1 do if Grouping.Collapsible then JSInterface.JSCall('getView().getFeature("grouping").collapseAll', []); Thank you very much!! Quote
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.