x11 Posted November 17, 2021 Share Posted November 17, 2021 Есть мобильный выпадающий список TUnimDBLookupComboBox. Он заполняется программно в событии OnRemoteQueryEx примерно так: for I := 0 to pred(ActionListMain.ActionCount) do begin if not ActionListMain.Actions[i].Hint.IsEmpty then Result.Add(ActionListMain.Actions[i].Hint); end; Так вот, можно ли сделать так, чтобы в выпадающем списке были awesome-иконки? Или это очень сложно? Т.е. компонента UnimDBLookupComboBox используется для простого выпадающего меню на смартфоне, поэтому хотелось бы изобразить не просто названия, а еще и значки. Может быть другой способ есть. Например, с помощью свойства ImageList. P.S. Дело в том, что какое-то простое специализированное меню не годится, т.к. требуется компонента со строкой ввода (фильтра), чтобы пользователь ввел несколько символов и программа выдала ему только нужные 2-3 пункта меню. Т.е. меню динамическое. Спасибо. Quote Link to comment Share on other sites More sharing options...
x11 Posted December 18, 2021 Author Share Posted December 18, 2021 up Quote Link to comment Share on other sites More sharing options...
x11 Posted February 15, 2022 Author Share Posted February 15, 2022 up Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 15, 2022 Share Posted February 15, 2022 On 11/17/2021 at 7:07 PM, x11 said: Так вот, можно ли сделать так, чтобы в выпадающем списке были awesome-иконки? Или это очень сложно? Ну, думаю можете попробовать использовать XTemplate. Quote Link to comment Share on other sites More sharing options...
x11 Posted February 15, 2022 Author Share Posted February 15, 2022 Есть примеры? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 15, 2022 Share Posted February 15, 2022 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 15, 2022 Share Posted February 15, 2022 with UniDBLookupComboBox2 do ClientEvents.UniEvents.Values['beforeInit'] := 'function beforeInit(sender, config) {'+ ' config.listConfig = {'+ ' tpl: new Ext.XTemplate('+ ' ''<tpl for="."><div class="x-boundlist-item" style="'+ Self.Font.ToStyleString(True) +'"><i class="x-fa fa-address-card"></i> {val}</div></tpl>'', {'+ ' disableFormats: true'+ ' }'+ ' )'+ ' };'+ '}'; 1 Quote Link to comment Share on other sites More sharing options...
x11 Posted February 15, 2022 Author Share Posted February 15, 2022 Нет, вы не поняли меня. У каждого пункта своя иконка, вот так: Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 15, 2022 Share Posted February 15, 2022 Я просто привел пример. Quote Link to comment Share on other sites More sharing options...
x11 Posted February 15, 2022 Author Share Posted February 15, 2022 Можно, конечно, попробовать использовать меню, но тогда не будет работать контекстный поиск/фильтрация. Ну чтобы пользователь ввел несколько символов для поиска и можно было отфильтровать нужные пункты. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 15, 2022 Share Posted February 15, 2022 Как я понимаю, это у Вас в базе хранятся значения? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 15, 2022 Share Posted February 15, 2022 Я имею в виду html коды иконок. Quote Link to comment Share on other sites More sharing options...
x11 Posted February 15, 2022 Author Share Posted February 15, 2022 Не в базе, а просто в TUniComboBox.items или в TUniTabControl.Tabs введены Quote <i class="fas fa-shopping-cart"></i> Операції <i class="fas fa-kaaba"></i> Типи <i class="fas fa-map-marker-alt"></i> Райони <i class="fas fa-sign"></i> Вулиці Quote Link to comment Share on other sites More sharing options...
x11 Posted February 15, 2022 Author Share Posted February 15, 2022 Опять же, похожая проблема и у десктопных компонент. Иконки вывести можно. Здесь работает то, что не работает в мобильной версии. Я было подумал, что у TUniTabControl есть свойство images, но его нет, т.е. нельзя привязать вкладки к индексам иконок из TUniNativeImageList. Quote Link to comment Share on other sites More sharing options...
x11 Posted February 15, 2022 Author Share Posted February 15, 2022 Вот, например, у TUniComboBox есть свойство IconItems. Я так подразумеваю, что оно связано со свойством Items и можно назначить индексы иконок всем строкам из Items. Вот было бы здорового, если бы и у TUniTabControl, и у TUnimDBLookupComboBox/TUnimComboBox было бы такое свойство. Чтобы все эти свойства у разных компонент были и работали одинаково. А то получается, что там есть, там нету. Приходится использовать кучу костылей, допиливать код вручную. 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.