Angelica Posted February 5, 2019 Share Posted February 5, 2019 Hi Dear : We have a problem with TUniComboBox, with Property: Font. I attach a document with the explanation. Thanks in advanced Angélica ( Arizmendi Team) Problem with TUniComboBox Properties .docx Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 5, 2019 Share Posted February 5, 2019 10 minutes ago, Angelica said: We have a problem with TUniComboBox, with Property: Font. Hello Angélica, Sorry, can you make a simple testcase for this?! Quote Link to comment Share on other sites More sharing options...
Angelica Posted February 5, 2019 Author Share Posted February 5, 2019 Hello Sherzod: I've made a simple testcase and I attached it. Thanks in advanced. Angélica ( Arizmendi Team). Unit1.dfm Unit1.pas Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 5, 2019 Share Posted February 5, 2019 1 hour ago, Angelica said: I've made a simple testcase and I attached it. Thanks for the testcase. Maybe one possible solution for now, can you try ? Uses ..., ExtPascalUtils; procedure TMainForm.UniFormCreate(Sender: TObject); begin with UniComboBox1 do ClientEvents.UniEvents.Values['beforeInit'] := 'function beforeInit(sender, config) {'+ ' config.listConfig = {'+ ' tpl: new Ext.XTemplate('+ ' ''<tpl for="."><div class="x-boundlist-item" style="'+ Font.ToStyleString(True) +'">{val}</div></tpl>'', {'+ ' disableFormats: true'+ ' }'+ ' )'+ ' };'+ '}'; end; Quote Link to comment Share on other sites More sharing options...
Angelica Posted February 6, 2019 Author Share Posted February 6, 2019 Hello Sherzod : How are you ? Thanks a lot. Another Subject: I do not know but i delete the title of this topic. I was trying copy the title, but it was deleted. Best regards. Angélica ( Arizmendi Team) Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 6, 2019 Share Posted February 6, 2019 Hello Angelica, I'm fine, thank you. And you?! OK, I will try Quote Link to comment Share on other sites More sharing options...
Kattes Posted June 23, 2020 Share Posted June 23, 2020 Thank you, That finally also worked for me ... Kattes procedure TMainForm.UniFormCreate(Sender: TObject); procedure AdjustDropDownFont(CB: tUniComboBox); begin // Only works if ItemIndex=0 is or if UniComboBox Style is csSimple ??? with CB do ClientEvents.UniEvents.Values['beforeInit'] := 'function beforeInit(sender, config) {'+ ' config.listConfig = {'+ ' tpl: new Ext.XTemplate('+ ' ''<tpl for="."><div class="x-boundlist-item" style="'+ Font.ToStyleString(True) +'">{val}</div></tpl>'', {'+ ' disableFormats: true'+ ' }'+ ' )'+ ' };'+ '}'; end; begin AdjustDropDownFont(UniComboBoxZahlart); AdjustDropDownFont(UniComboBoxPrintTicket); end; Quote Link to comment Share on other sites More sharing options...
picyka Posted May 27, 2021 Share Posted May 27, 2021 Em 23/6/2020 às 7:37 am, Kattes disse: Obrigado Que finalmente também funcionou para mim... Kattes procedure TMainForm.UniFormCreate(Sender: TObject); procedure AdjustDropDownFont(CB: tUniComboBox); begin // Only works if ItemIndex=0 is or if UniComboBox Style is csSimple ??? with CB do ClientEvents.UniEvents.Values['beforeInit'] := 'function beforeInit(sender, config) {'+ ' config.listConfig = {'+ ' tpl: new Ext.XTemplate('+ ' ''<tpl for="."><div class="x-boundlist-item" style="'+ Font.ToStyleString(True) +'">{val}</div></tpl>'', {'+ ' disableFormats: true'+ ' }'+ ' )'+ ' };'+ '}'; end; begin AdjustDropDownFont(UniComboBoxZahlart); AdjustDropDownFont(UniComboBoxPrintTicket); end; Hello, would it be possible to create one to define the font color? example: if Text.Constain ('Inactive') then color: = red; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 28, 2021 Share Posted May 28, 2021 8 hours ago, picyka said: Hello, would it be possible to create one to define the font color? example: if Text.Constain ('Inactive') then color: = red; Hello, Try this code: procedure TMainForm.UniFormCreate(Sender: TObject); begin with UniComboBox1 do ClientEvents.UniEvents.Values['beforeInit'] := 'function beforeInit(sender, config) {'+ ' config.listConfig = {'+ ' tpl: new Ext.XTemplate('+ ' ''<tpl for="."><div class="x-boundlist-item" style="{[this.check(values)]}">{val}</div></tpl>'', {'+ ' disableFormats: true,'+ ' check: function(values) {'+ ' if (values["val"] !== "Inactive") {return "'+ Font.ToStyleString(True) +'"} else {return "'+ Font.ToStyleString(True) +'; color: red;"}'+ ' }'+ ' }'+ ' )'+ ' }'+ '}'; end; Quote Link to comment Share on other sites More sharing options...
newsanti Posted April 8 Share Posted April 8 On 5/28/2021 at 12:56 PM, Sherzod said: Hello, Try this code: procedure TMainForm.UniFormCreate(Sender: TObject); begin with UniComboBox1 do ClientEvents.UniEvents.Values['beforeInit'] := 'function beforeInit(sender, config) {'+ ' config.listConfig = {'+ ' tpl: new Ext.XTemplate('+ ' ''<tpl for="."><div class="x-boundlist-item" style="{[this.check(values)]}">{val}</div></tpl>'', {'+ ' disableFormats: true,'+ ' check: function(values) {'+ ' if (values["val"] !== "Inactive") {return "'+ Font.ToStyleString(True) +'"} else {return "'+ Font.ToStyleString(True) +'; color: red;"}'+ ' }'+ ' }'+ ' )'+ ' }'+ '}'; end; TunimComboBox do not work. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 9 Share Posted April 9 On 4/8/2024 at 6:00 PM, newsanti said: TunimComboBox do not work. What exactly doesn't work? 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.