Jump to content

unibuttonwidget color


AntonioCuomo

Recommended Posts

Hello,

4 hours ago, AntonioCuomo said:

I would like to change the color of unibuttonwidget based on the value of a field. Example if value = 0 color = red value 1: green. there is no varying font caption

Based on what value? The values of the fields of this column?

By the way there is a solution, change the widget's color:

 

Link to comment
Share on other sites

image.thumb.png.c1f8474deccc98ab72c284353fdffe85.png

function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts)
{
    var widgetColIndx = 1;
    
    columns[widgetColIndx].onWidgetAttach = function(column, widget, record) {
        if (record.data[4] > 100) {
            widget.setStyle('border-color', 'green');
            widget.setStyle('background-image', 'linear-gradient(lime, green)');
        } else {
            widget.setStyle('border-color', 'red');
            widget.setStyle('background-image', 'linear-gradient(orange, red)');
        }
    };
}

 

Link to comment
Share on other sites

  • 2 years later...

Hi @Sherzod 

I would like to add two buttons to my Grid, one with a pen icon (to edit) and the other with a trash (to delete). How could I do it? I didn't quite understand how you went about placing this icon in the example above.

Link to comment
Share on other sites

10 hours ago, Sherzod said:

Hi @Redsis

Do you want to use two separate buttons or one with different icons?

Two separate, I created the buttons using the example, the only thing left to do was place the icons.

Link to comment
Share on other sites

19 minutes ago, Redsis said:

This way I had already managed to do it

Okay, very good.

 

19 minutes ago, Redsis said:

can I do it like a UniButton using HTML tag + FontAwasome?

15 hours ago, Redsis said:

I would like to add two buttons to my Grid, one with a pen icon (to edit) and the other with a trash (to delete). How could I do it? I didn't quite understand how you went about placing this icon in the example above.

I didn’t understand you then, perhaps you made a mistake in writing your question in this post, since the Widget button was used here.

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...