likemike Posted April 2, 2021 Share Posted April 2, 2021 Hello! The "FieldlabelFont" works as expected, but the "Font"-property doesn't. The itemlist is always the same small size, even if I set the Font -> Size property to e.g. 20. So the question is: How can I set font for the list items in TUnimSelect? Thanks in advance and happy eastern Mike Link to comment Share on other sites More sharing options...
likemike Posted April 2, 2021 Author Share Posted April 2, 2021 Why this CSS-code doesn't work? .mySelectlist .x-list-item { font-size: 20px !important; } Link to comment Share on other sites More sharing options...
likemike Posted April 3, 2021 Author Share Posted April 3, 2021 Here is the working solution from Sherzod: procedure TMainmForm.UnimFormCreate(Sender: TObject); begin with UnimSelect1 do begin JSInterface.JSConfig('itemTpl', ['<span class="x-list-label" style="'+ Font.ToStyleString(True) +'; font-size: '+ (Font.Size+11).ToString() +'px">{val:htmlEncode}</span>']); end; end; Link to comment Share on other sites More sharing options...
Sherzod Posted April 3, 2021 Share Posted April 3, 2021 2 hours ago, likemike said: Here is the working solution from Sherzod: Also this solution: with UnimSelect1 do begin //JSInterface.JSConfig('itemTpl', ['<span class="x-list-label" style="'+ Font.ToStyleString(True) +'; font-size: '+ (Font.Size+11).ToString() +'px">{val:htmlEncode}</span>']); JSInterface.JSConfig('itemTpl', ['<span class="x-list-label" style="'+ Font.ToStyleString(True, False, True) +'">{val:htmlEncode}</span>']); end; Link to comment Share on other sites More sharing options...
x11 Posted December 16, 2021 Share Posted December 16, 2021 On 4/3/2021 at 4:53 PM, Sherzod said: JSInterface.JSConfig('itemTpl', ['<span class="x-list-label" style="'+ Font.ToStyleString(True, False, True) +'">{val:htmlEncode}</span>']); Tell me, where is the font size set here? Link to comment Share on other sites More sharing options...
x11 Posted December 16, 2021 Share Posted December 16, 2021 I understand procedure SetFontunimSelect(sel: TunimSelect; iSize: integer; WordWrap: Boolean); begin // размер шрифта для выпадающего списка unimSelect sel.JSInterface.JSConfig('itemTpl', ['<span class="x-list-label" style="' + sel.Font.ToStyleString(True, False, True) + '; font-size: ' + iSize.ToString + 'px; ' + ifthen(WordWrap, 'word-break: break-all', '') + '">{val:htmlEncode}</span>']); end; Link to comment Share on other sites More sharing options...
Recommended Posts