Jump to content

UniButton. Замена свойству WordWrap


MSMK

Recommended Posts

Доброе время суток! Столкнулся с проблемой переноса текста в  свойстве Caption у объекта UniButton. Текст с большим размером не переносится и получается, что не влезает в рамки кнопки. Свойство WordWrap  у кнопки не нашел. Как быть?

post-6459-0-00032100-1535098556_thumb.jpg

Link to comment
Share on other sites

Добрый день,

 

Одно из возможных решений:

 

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'
}
Link to comment
Share on other sites

 

Добрый день,

 

Одно из возможных решений:

 

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
Link to comment
Share on other sites

Проверьте еще раз

Проверил, все равно выдает ошибку. Заметил то что если добавить любое  событие в UniEvents, выдает такую ошибку

Link to comment
Share on other sites

 

Добрый день,

 

Одно из возможных решений:

 

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'}

Спасибо за решение

Link to comment
Share on other sites

  • 1 year later...
1 hour ago, Kenneth said:

Добрый день почему то для мобильной версии, т.е. для TUnimButton данный вариант не срабатывает. Не подскажите почему?

Здравствуйте,

Попробуйте этот CustomCSS:

.wordwrapbtn .x-text-el {    
    white-space: normal;    
    text-align: center;
}

 

Link to comment
Share on other sites

Теперь не могу изменить свойство в TUnimEdit. Хочу сделать чтобы текст был по центру.

Добавил в CustomCSS:

.editCenter {

 text-align: center;

}

Не работает.

.editCenter <вот сюда что писать для TUnimEdit?>{

 text-align: center;

}

Link to comment
Share on other sites

  • 2 years later...
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?

image.png.7e1b822c0a660f1eba98bdfea11aa54f.png

Like this:

image.png.ccc0e6a018609a968793d34eae635513.png

Link to comment
Share on other sites

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:

image.png.ce906b59bfe9871ccd4e0ee0d4d7b104.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...