x11 Posted November 13, 2021 Share Posted November 13, 2021 Подскажите, пожалуйста, как убрать перенос текста у строк в TuniListBox? И еще, как убрать нижнюю полосу прокрутки? Спасибо. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 13, 2021 Share Posted November 13, 2021 6 minutes ago, x11 said: как убрать перенос текста у строк в TuniListBox? А как должно быть, с горизонтальной прокруткой!? Quote Link to comment Share on other sites More sharing options...
x11 Posted November 13, 2021 Author Share Posted November 13, 2021 сделать прокрутку только вверх-вниз, пусть текст прячется, обрезается.... Quote Link to comment Share on other sites More sharing options...
x11 Posted November 13, 2021 Author Share Posted November 13, 2021 Еще вопрос. Т.к. весь текст будет скрыт, то можно ли сделать так, чтобы на каждую строку былая своя всплывающая подсказка, чтобы в ней был полный текст строки? Спасибо. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 13, 2021 Share Posted November 13, 2021 46 minutes ago, x11 said: Т.к. весь текст будет скрыт, то можно ли сделать так, чтобы на каждую строку былая своя всплывающая подсказка, чтобы в ней был полный текст строки? Попробуйте: function beforeInit(sender, config) { config.listConfig = { tpl: new Ext.XTemplate('<tpl for="."><li style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap;" title="{val}" role="option" unselectable="on" class="x-boundlist-item">{val}</li></tpl>') } } 1 Quote Link to comment Share on other sites More sharing options...
x11 Posted November 13, 2021 Author Share Posted November 13, 2021 Суппппер! Почти то, что надо. Осталось скрыть нижнюю полосу прокрутки. Я, честно говоря, слегка удивлен, что у листбокса нет свойства, отвечающего за полосы прокрутки. Quote Link to comment Share on other sites More sharing options...
x11 Posted November 13, 2021 Author Share Posted November 13, 2021 Такс... не совсем супер. Возникли проблемы. Исчезли чекбоксы и мультивыбор. Как выбрать несколько строк? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 13, 2021 Share Posted November 13, 2021 26 minutes ago, x11 said: Такс... не совсем супер. Возникли проблемы. Исчезли чекбоксы и мультивыбор. Да, простите, при использовании чекбокса - да, там используется другой template, а мы перезаписываем (Хотя с мультивыбором я не увидел проблему). Quote Link to comment Share on other sites More sharing options...
x11 Posted November 13, 2021 Author Share Posted November 13, 2021 невозможно выбрать ни единой строки и свойство SelCount всегда возвращает 0 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 13, 2021 Share Posted November 13, 2021 3 minutes ago, x11 said: невозможно выбрать ни единой строки и свойство SelCount всегда возвращает 0 Ok. Тогда можно попробовать применить CSS, но мне кажется, для аттрибута title, нужно будет искать другое решение. Quote Link to comment Share on other sites More sharing options...
x11 Posted November 13, 2021 Author Share Posted November 13, 2021 ну хотя бы без title его можно выводить в каком-нибудь отдельном uniLabel Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 13, 2021 Share Posted November 13, 2021 49 minutes ago, Sherzod said: function beforeInit(sender, config) { config.listConfig = { tpl: new Ext.XTemplate('<tpl for="."><li style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap;" title="{val}" role="option" unselectable="on" class="x-boundlist-item">{val}</li></tpl>') } } function beforeInit(sender, config) { config.listConfig = { tpl: new Ext.XTemplate('<tpl for="."><li style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap;" title="{val}" role="option" unselectable="on" class="x-boundlist-item">{val}</li></tpl>') } } 1. LayoutConfig -> Cls = customList 2. .customList .x-boundlist-item { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } 1 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 13, 2021 Share Posted November 13, 2021 50 minutes ago, x11 said: Осталось скрыть нижнюю полосу прокрутки. Кажется и этот вопрос решен. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 13, 2021 Share Posted November 13, 2021 32 minutes ago, x11 said: ну хотя бы без title 35 minutes ago, Sherzod said: но мне кажется, для аттрибута title, нужно будет искать другое решение function afterrender(sender, eOpts) { sender.tip = Ext.create('Ext.tip.ToolTip', { target: sender.el, delegate: '.x-boundlist-item', listeners: { beforeshow: function updateTipBody(tip) { tip.update(Ext.get(tip.triggerElement).dom.innerText); } } }); } 1 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 13, 2021 Share Posted November 13, 2021 54 minutes ago, x11 said: ну хотя бы без title... Показ всплывающей подсказки, только тогда, когда текст обрезается: function afterrender(sender, eOpts) { sender.tip = Ext.create('Ext.tip.ToolTip', { target: sender.el, delegate: '.x-boundlist-item', listeners: { beforeshow: function updateTipBody(tip) { var tm = new Ext.util.TextMetrics(); var _width = tm.getSize(Ext.get(tip.triggerElement).dom.innerText).width; var _someValueToAddWidth = 44; if (_width+_someValueToAddWidth >= sender.getWidth()) { tip.update(Ext.get(tip.triggerElement).dom.innerText); } else { return false; } } } }); } 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.