AntonioCuomo Posted July 31, 2021 Share Posted July 31, 2021 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 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 1, 2021 Share Posted August 1, 2021 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: Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 1, 2021 Share Posted August 1, 2021 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)'); } }; } Quote Link to comment Share on other sites More sharing options...
Redsis Posted March 25 Share Posted March 25 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. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 26 Share Posted March 26 Hi @Redsis Do you want to use two separate buttons or one with different icons? Quote Link to comment Share on other sites More sharing options...
Redsis Posted March 26 Share Posted March 26 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. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 26 Share Posted March 26 @Redsis 17 minutes ago, Redsis said: the only thing left to do was place the icons. Quote Link to comment Share on other sites More sharing options...
Redsis Posted March 26 Share Posted March 26 15 minutes ago, Sherzod said: @Redsis This way I had already managed to do it, can I do it like a UniButton using HTML tag + FontAwasome? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 26 Share Posted March 26 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. 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.