Mirco Posted February 1, 2023 Share Posted February 1, 2023 Hi, i need to change the background color of the rows of a listbox to make them have 2 different colors for the odd and even rows. It's possible? Thank you Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 1, 2023 Share Posted February 1, 2023 2 hours ago, Mirco said: i need to change the background color of the rows of a listbox to make them have 2 different colors for the odd and even rows. It's possible? Hello, I will try to analyze. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 2, 2023 Share Posted February 2, 2023 18 hours ago, Mirco said: i need to change the background color of the rows of a listbox to make them have 2 different colors for the odd and even rows. It's possible? Hello, Try this approach: procedure TMainForm.UniFormCreate(Sender: TObject); begin with UniListBox1.JSInterface do JSConfigObject('listConfig', 'tpl', [ JSStatement('new Ext.XTemplate(''<tpl for=".">'',' + ' ''<li role="option" unselectable="on" class="x-boundlist-item {[xindex % 2 === 0 ? "x-grid-item-alt" : ""]}">'', '+ ' ''{val}</li></tpl>'')' )] ); end; 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.