MSMK Posted August 24, 2018 Share Posted August 24, 2018 Доброе время суток! Столкнулся с проблемой переноса текста в свойстве Caption у объекта UniButton. Текст с большим размером не переносится и получается, что не влезает в рамки кнопки. Свойство WordWrap у кнопки не нашел. Как быть? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 24, 2018 Share Posted August 24, 2018 Добрый день, Одно из возможных решений: 1. UniServerModule -> CustomCSS: .wordwrapbtn .x-btn-button { white-space: normal; text-align: center; } 2. UniButton -> ClientEvents -> UniEvents -> function beforeInit: function beforeInit(sender, config) { config.cls='wordwrapbtn' } Quote Link to comment Share on other sites More sharing options...
MSMK Posted August 24, 2018 Author Share Posted August 24, 2018 Добрый день, Одно из возможных решений: 1. UniServerModule -> CustomCSS: .wordwrapbtn .x-btn-button { white-space: normal; text-align: center; } 2. UniButton -> ClientEvents -> UniEvents -> function beforeInit: function beforeInit(sender, config) { config.cls='wordwrapbtn' } сделал как написано. Появляется ошибка: Ajax error missing { before function body Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 24, 2018 Share Posted August 24, 2018 2. UniButton -> ClientEvents -> UniEvents -> function beforeInit: function beforeInit(sender, config) { config.cls='wordwrapbtn' } Проверьте еще раз Quote Link to comment Share on other sites More sharing options...
MSMK Posted August 24, 2018 Author Share Posted August 24, 2018 Проверьте еще раз Проверил, все равно выдает ошибку. Заметил то что если добавить любое событие в UniEvents, выдает такую ошибку Quote Link to comment Share on other sites More sharing options...
MSMK Posted August 24, 2018 Author Share Posted August 24, 2018 пробовал сделать сортировку грида на клиентской стороне, как это описано в статье http://forums.unigui.com/index.php?/topic/6225-dbgrid-clientside-sorting/, также аналогично падает ошибка Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 24, 2018 Share Posted August 24, 2018 Какую сборку используете? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 24, 2018 Share Posted August 24, 2018 Можете сделать тестовый случай и прикрепить здесь? Quote Link to comment Share on other sites More sharing options...
MSMK Posted August 24, 2018 Author Share Posted August 24, 2018 Какую сборку используете? сборка FMSoft_uniGUI_Complete_Professional_1.50.0.1476. Quote Link to comment Share on other sites More sharing options...
MSMK Posted August 24, 2018 Author Share Posted August 24, 2018 попробовал тестовый проект накидать, запустил и все норм работает. Странно в чем проблема ... Quote Link to comment Share on other sites More sharing options...
MSMK Posted August 24, 2018 Author Share Posted August 24, 2018 тестовый проект https://yadi.sk/d/YyrRWifW3aXKkV Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 24, 2018 Share Posted August 24, 2018 Quote Link to comment Share on other sites More sharing options...
MSMK Posted August 24, 2018 Author Share Posted August 24, 2018 Нашел причину, конфликт с вызовом локализации текста на фрейме Quote Link to comment Share on other sites More sharing options...
MSMK Posted August 24, 2018 Author Share Posted August 24, 2018 Добрый день, Одно из возможных решений: 1. UniServerModule -> CustomCSS: .wordwrapbtn .x-btn-button { white-space: normal; text-align: center;} 2. UniButton -> ClientEvents -> UniEvents -> function beforeInit: function beforeInit(sender, config){ config.cls='wordwrapbtn'} Спасибо за решение Quote Link to comment Share on other sites More sharing options...
Kenneth Posted January 13, 2020 Share Posted January 13, 2020 Добрый день почему то для мобильной версии, т.е. для TUnimButton данный вариант не срабатывает. Не подскажите почему? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 13, 2020 Share Posted January 13, 2020 1 hour ago, Kenneth said: Добрый день почему то для мобильной версии, т.е. для TUnimButton данный вариант не срабатывает. Не подскажите почему? Здравствуйте, Попробуйте этот CustomCSS: .wordwrapbtn .x-text-el { white-space: normal; text-align: center; } Quote Link to comment Share on other sites More sharing options...
Kenneth Posted January 13, 2020 Share Posted January 13, 2020 3 minutes ago, Sherzod said: Здравствуйте, Попробуйте этот CustomCSS: .wordwrapbtn .x-text-el { white-space: normal; text-align: center; } Спасибо! Сработало. Quote Link to comment Share on other sites More sharing options...
Kenneth Posted January 13, 2020 Share Posted January 13, 2020 Теперь не могу изменить свойство в TUnimEdit. Хочу сделать чтобы текст был по центру. Добавил в CustomCSS: .editCenter { text-align: center; } Не работает. .editCenter <вот сюда что писать для TUnimEdit?>{ text-align: center; } Quote Link to comment Share on other sites More sharing options...
Kenneth Posted January 13, 2020 Share Posted January 13, 2020 Все разобрался: .editCenter .x-input-el { text-align: center; } Quote Link to comment Share on other sites More sharing options...
artem_niko Posted May 4, 2022 Share Posted May 4, 2022 On 8/24/2018 at 5:02 PM, Sherzod said: Добрый день, Одно из возможных решений: 1. UniServerModule -> CustomCSS: .wordwrapbtn .x-btn-button { white-space: normal; text-align: center; } 2. UniButton -> ClientEvents -> UniEvents -> function beforeInit: function beforeInit(sender, config) { config.cls='wordwrapbtn' } Greetings! It seems that the solution is suitable, but for some reason I have too much space between the line in the button title. Wrapping is in progress, but how to reduce the line spacing? Like this: Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 4, 2022 Share Posted May 4, 2022 Hello @artem_niko I couldn't reproduce. 1 hour ago, artem_niko said: 1. UniServerModule -> CustomCSS: .wordwrapbtn .x-btn-button { white-space: normal; text-align: center; } 2. UniButton -> ClientEvents -> UniEvents -> function beforeInit: function beforeInit(sender, config) { config.cls='wordwrapbtn' } Works for me: Quote Link to comment Share on other sites More sharing options...
artem_niko Posted May 4, 2022 Share Posted May 4, 2022 2 minutes ago, Sherzod said: Hello @artem_niko I couldn't reproduce. Works for me: Ok...maybe this is bug in UniFSComponents from @Marlon Nardi. Need comment from him. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 4, 2022 Share Posted May 4, 2022 2 minutes ago, artem_niko said: Ok...maybe this is bug in UniFSComponents Just try on UniButton first. Quote Link to comment Share on other sites More sharing options...
artem_niko Posted May 4, 2022 Share Posted May 4, 2022 11 minutes ago, Sherzod said: Just try on UniButton first. In standart UniButton result: As is UniFSButton... Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 4, 2022 Share Posted May 4, 2022 9 minutes ago, artem_niko said: In standart UniButton result: As is UniFSButton... So you have a conflict with some CSS rules that you use in your app. 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.