Jump to content

LayoutConfig.cls


CAVeter

Recommended Posts

  • 1 month later...
  • 6 months later...
On 9/5/2019 at 8:43 PM, NizamUlMulk said:

Is possible assign cls at runtime?. 
The property isn´t disponible for LayoutConfig...
 

@Sherzod,

For UniDBGrid  ( .cls property  is protected ).

Would like to use this :   UniDbgrid1.LayoutConfig.Cls := 'myCustomCls';    At runTime  !

because i have two behaviors for the same unidbgrid  (Arabic Font are bigger then Latin Font).

The logic would be :

if Arabic then UniDbgrid1.LayoutConfig.Cls := 'ClsA'  else   UniDbgrid1.LayoutConfig.Cls := 'ClsL';

Thx.

Link to comment
Share on other sites

20 minutes ago, Abaksoft said:

if Arabic then UniDbgrid1.LayoutConfig.Cls := 'ClsA'  else   UniDbgrid1.LayoutConfig.Cls := 'ClsL';

Hi,

You can also use like this:

UniDBGrid1.JSInterface.JSCall('addCls', ['ClsA']);

For remove:

UniDBGrid1.JSInterface.JSCall('removeCls', ['className']);

 

  • Upvote 1
Link to comment
Share on other sites

This is another alternative before that properties been public.
 

uses
  uniGUIVars,.......

type AliCengiz_LayoutConfig = class(TUniCustomLayoutConfig);
.....
procedure Tfrm_xxxx.UniLoginFormCreate(Sender: TObject);
begin
     AliCengiz_LayoutConfig(xxxxx.LayoutConfig).Cls:= 'css-falan';
     AliCengiz_LayoutConfig(yyyyy.LayoutConfig).BodyCls:= 'css-filan';

 

  • Upvote 1
Link to comment
Share on other sites

1 hour ago, Sherzod said:

Hi,

You can also use like this:


UniDBGrid1.JSInterface.JSCall('addCls', ['ClsA']);

For remove:


UniDBGrid1.JSInterface.JSCall('removeCls', ['className']);

 

 

Thank you Sherzod,

Not totally solved.

Cls1 to Cls2  :  works fine.  but when I come back

Cls2 to Cls1  :  not works !?

Sure i am missing something.

Can you please examine my testCase ?

Thx.

cls_Runtime.zip

Link to comment
Share on other sites

9 minutes ago, Sherzod said:

UniDBGrid1.JSInterface.JSCall('removeCls', ['className']);

className - Name of your class //ClsA or ClsB I guess 

 

Oh...Sorry

I thaught "className"  was a JS property !  (to my great igorance)

That woks fine now

Thank again :)

Link to comment
Share on other sites

1 hour ago, Freeman35 said:

This is another alternative before that properties been public.
 


uses
  uniGUIVars,.......

type AliCengiz_LayoutConfig = class(TUniCustomLayoutConfig);
.....
procedure Tfrm_xxxx.UniLoginFormCreate(Sender: TObject);
begin
     AliCengiz_LayoutConfig(xxxxx.LayoutConfig).Cls:= 'css-falan';
     AliCengiz_LayoutConfig(yyyyy.LayoutConfig).BodyCls:= 'css-filan';

 

Thank you FreeMaaaaaan,

Also, i will study your code :)

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...