Jump to content

Wordwrap in UniButtonWidget


artem_niko

Recommended Posts

Hello!

If set DisplayMemo=True for column in UniDbGrid, that it's working fine, text is wraping:

image.png.11086643bf9f057877685f7918cf0e71.png

But, if set DisplayMemo=True for column and use for field, that text is not wraping in caption of UniButtonWidget:

image.png.b8e9ca90a17d7a430904a24b1d9df338.png

Please, help me make that text will be wraping when I use UniButtonWidgetFor column in UniDBgrid?

Link to comment
Share on other sites

Hello,

4 hours ago, Артем said:

text is not wraping in caption of UniButtonWidget

Well this is normal behavior I think.

4 hours ago, Артем said:

help me make that text will be wraping when I use UniButtonWidgetFor column in UniDBgrid?

And the maximum string value?

Link to comment
Share on other sites

28 minutes ago, Артем said:

No, not for the maximum string value.

 I need the caption text to wrap if its length exceeds the width of the button.

What I want to say is that the button is not really used for long lines, because wrapping is one of the points, the other is height ...
Therefore, I asked about the approximate maximum string length.

Link to comment
Share on other sites

Just now, Sherzod said:

What I want to say is that the button is not really used for long lines, because wrapping is one of the points, the other is height ...
Therefore, I asked about the approximate maximum string length.

i'm don't know about the approximate string length...))

She can be different.

Widht of the button - is fixed.

Link to comment
Share on other sites

7 minutes ago, Артем said:

i'm don't know about the approximate string length...))

Then try this approach:

function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts)
{
    var widgetColIndx=1;
    columns[widgetColIndx].onWidgetAttach = function(column, widget, record) {
        widget.setTextAlign('left');
        widget.setHeight(40);
        widget.btnInnerEl.setStyle('white-space', 'normal');
    };
}

 

  • Like 1
Link to comment
Share on other sites

10 minutes ago, Sherzod said:

Then try this approach:


function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts)
{
    var widgetColIndx=1;
    columns[widgetColIndx].onWidgetAttach = function(column, widget, record) {
        widget.setTextAlign('left');
        widget.setHeight(40);
        widget.btnInnerEl.setStyle('white-space', 'normal');
    };
}

 

Cool! Working.

But one question: why for the first button height not normal?

image.png.d9e0eed7e7781ecacff8d15e95c8a684.png

I mean, is it possible make auto adjust height for the button?

Link to comment
Share on other sites

28 minutes ago, Артем said:

I will be waiting answer from you!

Try this:

function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts)
{
    var widgetColIndx=1;
    columns[widgetColIndx].onWidgetAttach = function(column, widget, record) {
        widget.setTextAlign('left');
        widget.setHeight('auto');
        widget.btnInnerEl.setStyle('white-space', 'normal');
    };
}

 

  • Like 2
Link to comment
Share on other sites

11 minutes ago, Sherzod said:

Try this:


function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts)
{
    var widgetColIndx=1;
    columns[widgetColIndx].onWidgetAttach = function(column, widget, record) {
        widget.setTextAlign('left');
        widget.setHeight('auto');
        widget.btnInnerEl.setStyle('white-space', 'normal');
    };
}

 

Perfect!!! Working very fine!

Thank's, @Sherzod! :)

  • Like 1
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...