Form Background Color

Goodmorning all,

Is there anyway to change the form background color dynamically?

I have a classic grid that opens a form scenario for customer data, and I want it to work so that if I open a customer that is giving trouble, then the form background color becomes red.


There is no native options and we don’t provide such possibility, but i can mention, that the form background CSS style is the next:

.dhxlist_obj_dhx_skyblue div.dhxlist_base { background-color: yellow }


Could you please provide two screenshots one with normal app state and one how you need it (you can use same screenshot just add some colors in corresponding places to see the difference)?

Ok, here you have two views of the same layout.

The first, customerList.jpg shows the list of customers, the ones with the red backround on the grid are the ones that have been blocked

The second image, customerDetails.jpg appears when you doubleclick on one of the customers on the grid. IF the customer is blocked, I want the back of this form (customerDetails.jpg) to be RED instead of white, to warn the user that the customer is blocked…

(Just imagine the background of the form changing color dynamically, i.e. when I load the form, IF the customer is blocked, the background has to be red.

imho not very good idea to work looking at red bg, but …

var w1 = dhxWins.window(id); // or you probably already have window instance w1.vs[w1.av]"#ffe0e0";

how about just show topmost label in red “Customer is blocked”?

Yep Andrei, I agree with your color preferences … The whole point is the user MUST NOT work with a customer that is blocked, so the red is to discourage work !!


OK Sergei,
I think I’m on the right track, but I think that firstchild is wrong:

I have the following stucture:

// my window, “clientiWin” is the occurance you mentioned …
var clientiWin = mainLayout.dhxWins.createWindow(“wclienti”, 20, 20, 800, 600);

// The layout inside the window
clientiLayout = new dhtmlXLayoutObject(clientiWin,“1C”);

// A toolbar
clientiToolbar = clientiLayout.cells(“a”).attachToolbar();

// A grid in the normal view - view(“def”)
clientiGrid = clientiLayout.cells(“a”).attachGrid();

// and a form in the form view - view(“form”)
clientiForm = clientiLayout.cells(“a”).view(“form”).attachForm(formData);
// this is the element I have to change the backgound of

So I think I am not hitting the form when I call:


correct, by screenshot seems like only window and form used.
for layout:

clientiLayout.cells(“a”).vs[viewName] =…
viewName=“form” in your case

Sorry Andrei, still NOT working!

please provide link or send it to (include link to this topic)

I don’t know if you ever figured this issue out, but you can do the following"#eef5e6";

clientiForm being the form name
#eef5e6 being whatever color you want