Jump to content

How to create TuniStringGrid CSS at Run-Time?


newsanti

Recommended Posts

1.Create CSS at Run-Time 
------------------
 oList:= TStringList.Create;
  oList.Add('.customGrid .x-grid-td {');
  oList.Add('    line-height: normal;');
  oList.Add('    vertical-align: middle;');
  oList.Add('}');
oList.Free.
-----------------

2. How to use oList.Text...for Step3 at run-time ?

3. Grid1.JSInterface.JSCall('addCls', ['customGrid']);
 

Link to comment
Share on other sites

18 hours ago, Sherzod said:

Also you can use this approach:

 

procedure TMainForm.UniFormCreate(Sender: TObject);
begin  
  UniSession.AddJS('Ext.util.CSS.createStyleSheet(".x-grid-group-title {font-size: 12px;}")');
end;

How to remove css for memory management?

 

Link to comment
Share on other sites

On 1/10/2023 at 8:50 PM, newsanti said:
procedure TMainForm.UniFormCreate(Sender: TObject);
begin  
  UniSession.AddJS('Ext.util.CSS.createStyleSheet(".x-grid-group-title {font-size: 12px;}")');
end;

How to remove css for memory management?

 

 

UniSession.AddJS('Ext.util.CSS.createStyleSheet(".x-grid-group-title {font-size: 12px;}", "customId")');

UniSession.AddJS('Ext.util.CSS.removeStyleSheet("customId")');

 

  • Like 1
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...