irigsoft Posted February 12, 2023 Share Posted February 12, 2023 Hello, I try to add style "content-visibility : auto" for all my component created on runtime. I use this code, but I am not sure if is work. Is this code OK , or there is better code ? UniSession.AddJS('Ext.util.CSS.createStyleSheet("#' + TUniControl (MyControl).JSId + ' {content-visibility: auto; !important;}")'); or this with TUniControl (MyControl), JSInterface do begin JSCallGlobal('Ext.util.CSS.createStyleSheet' , ['#' + JSId + ' { content-visibility: auto; !important;}' , JSName + '_css1']); end; I try to speed up rendering of components in my form based on this: https://web.dev/content-visibility/ Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 12, 2023 Share Posted February 12, 2023 Hello, Better to use cls, userCls, componentCls... configs I think. Quote Link to comment Share on other sites More sharing options...
irigsoft Posted February 12, 2023 Author Share Posted February 12, 2023 15 minutes ago, Sherzod said: Hello, Better to use cls, userCls, componentCls... configs I think. Thanks, but can you give me an example (some code) ? Quote Link to comment Share on other sites More sharing options...
irigsoft Posted February 12, 2023 Author Share Posted February 12, 2023 38 minutes ago, Sherzod said: Hello, Better to use cls, userCls, componentCls... configs I think. I will use this: Quote Link to comment Share on other sites More sharing options...
irigsoft Posted February 12, 2023 Author Share Posted February 12, 2023 @Sherzod, I make it to work : 1. when create component (in Form.OnCreate event) i set : TUniControl (MyComponent).JSInterface.JSConfig('userCls', ['customCSSBtn']); 2. in customcss .customCSSBtn.x-btn .x-btn-inner { color: gray !important; } .customCSSBtn:hover { background-color: #ff8c00; } .customCSSBtn.x-pressing { background-color: #ee7600 } my code is based to : 1 Quote Link to comment Share on other sites More sharing options...
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.