likemike Posted March 24, 2021 Share Posted March 24, 2021 Hello! Due to design reasons, I'd like to put some distance between the buttons of an UnimSegmentedButton. Is that possible? Thanks in advance Mike Link to comment Share on other sites More sharing options...
likemike Posted March 24, 2021 Author Share Posted March 24, 2021 and by the way... is it possible to change the background color of each button? That would be great!! I've tried this: with UniButton1.JSInterface do begin JSCall('btnWrap.setStyle', ['background-image', '"none"']); JSCall('btnWrap.setStyle', ['background-color', 'rgb(0,128,128)']); end; ...but with mobile version UnimButton1 an error (setStyle is undefined) appears. Link to comment Share on other sites More sharing options...
likemike Posted March 24, 2021 Author Share Posted March 24, 2021 Hello! First of all I want to thank Sherzod for his good work and fast answers. But there is something fundamentally wrong here. I've tried all things I've found in this forum to change the color of a damned UnimButton. None of the tipps and hints worked for me. This cost me 4 hours without result. It's because I'm too stupid? Maybe - but I do programming more than 30 years. So my question is: where can I get the desired information to help myself (and later for sure others)? I was looking at this page https://docs.sencha.com/extjs/7.0.0/modern/Ext.html but I've found nothing helpful. Is there any documentation where I can find answers how to set properties for components and all the other JS stuff? There must be something, because obviously Sherzod knows it all. I would be thankful if someone could send me some links or documents.... Regards Mike Link to comment Share on other sites More sharing options...
Sherzod Posted March 25, 2021 Share Posted March 25, 2021 9 hours ago, likemike said: Due to design reasons, I'd like to put some distance between the buttons of an UnimSegmentedButton. Is that possible? Hello, Try this config: UnimSegmentedButton -> ClientEvents -> UniEvents -> function beforeInit(sender, config) { config.defaults = { margin: '5px' } } Link to comment Share on other sites More sharing options...
likemike Posted March 25, 2021 Author Share Posted March 25, 2021 Thanks! And what about the background color of buttons? Link to comment Share on other sites More sharing options...
Sherzod Posted March 25, 2021 Share Posted March 25, 2021 3 minutes ago, likemike said: And what about the background color of buttons? Have you tried searching on the forum? Link to comment Share on other sites More sharing options...
likemike Posted March 25, 2021 Author Share Posted March 25, 2021 Yes I do! .x-button .x-inner-el { background: #1E90FF; !important; } But this has no effect. Link to comment Share on other sites More sharing options...
likemike Posted March 25, 2021 Author Share Posted March 25, 2021 I forgot to mention, that I need the button color to be changed at runtime. Link to comment Share on other sites More sharing options...
likemike Posted March 25, 2021 Author Share Posted March 25, 2021 3 hours ago, Sherzod said: Hello, Try this config: UnimSegmentedButton -> ClientEvents -> UniEvents -> function beforeInit(sender, config) { config.defaults = { margin: '5px' } } This works! But I need the margin only left and right, So I've tried a bit and I've found out, that this could be solved by: function beforeInit(sender, config) { config.defaults = { margin: '0px 15px 0px' } } But other CSS-commands like margin-top: 100px; margin-bottom: 100px; margin-right: 150px; margin-left: 80px; don't work (error: "Unexpected identifier"). So my question is: How can I learn, which commands are allowed? Is there any documentation about that? Regards Mike Link to comment Share on other sites More sharing options...
Ron Posted March 25, 2021 Share Posted March 25, 2021 It is all based on ExtJS, where you can find the documentation: https://docs.sencha.com/extjs/7.0.0/modern/Ext.SegmentedButton.html#cfg-margin Granted, ExtJS is a bit complex... Link to comment Share on other sites More sharing options...
Sherzod Posted March 25, 2021 Share Posted March 25, 2021 7 hours ago, likemike said: But other CSS-commands like margin-top: 100px; margin-bottom: 100px; margin-right: 150px; margin-left: 80px; In this case, you should try using the style config. Link to comment Share on other sites More sharing options...
Recommended Posts