cancel
Showing results for 
Search instead for 
Did you mean: 

problem binding color to button in treetable

thomashammer
Advisor
Advisor
0 Kudos

Hey,

I'd like to bind a color to a button-style so that the background-color of the button is automatically set.

Actually I could not find a way to do that. Therefore I tried another solution.

I'm using that button as a kind of color-indicator. After clicking the button, a color-picker dialog is displayed. Changing the color within the color-picker, the button-background-color also is changed.

To change the color I use this command:

//id : button-id; colorstring: rgba color code

$('#'+ id).css("cssText", "background: " +  colorString + " !important;");

So far everything is fine.

However, in case that one table-rows will be deleted, the color gets lost and the background is set to the background of the former element on that position.

It seems like the treetable updates the assignment of the style-classes depending on the row-count.

The red button is the one that i want to color automatically by binding. (hope that would solve the problem)

Hope you can understand my problem.

Thank you in advance.

BR

View Entire Topic
former_member182862
Active Contributor
0 Kudos

Hi Thomas

You can extend the button control to do this and it will simplify thing a lot.

Thanks

-D

thomashammer
Advisor
Advisor
0 Kudos

Thanks Dennis and Kedar,

resolved my problem by extending the standard button control.

BR

Thomas