PDA

View Full Version : [CLOSED] changing Gridpanel cell Color from Backend



extnetuser
Apr 18, 2013, 6:46 PM
hi,
for example i use this one: http://examples2.ext.net/#/GridPanel/ArrayGrid/Simple/
and i would like to change the gridPanel cell background color from the back end code like,


GridPanel_ID.ColumnModel.Columns[1].Text = param["title"];

give some style on the data cell depending some condition (like if the price is greater then 50)

i know it can be done by calling the Renderer or Fn. but i would like to done it by code behind (not use the javascript) like
GridPanel_ID.ColumnModel.Columns[1].Text = param["title"];. this way.

Thanks in Advance.

Baidaly
Apr 18, 2013, 10:39 PM
Hello!

Unfortunately, you cannot do this without using JS because Grid renders on client side. However, why do you need this? Maybe there is some other option?

extnetuser
Apr 19, 2013, 11:54 AM
Hello!

Unfortunately, you cannot do this without using JS because Grid renders on client side. However, why do you need this? Maybe there is some other option?

HI, for example, the gridPanel[1][1] position contain a value(75). I want to set some condition like, if the value greater then 50 then the cell back-ground colour will be red. this type of condition. so, set some logic with the gridPanel, but without help of js.

is there any other way??
Thanks

Daniil
Apr 19, 2013, 2:02 PM
Generally, it is only possible to do with a Renderer. A GridPanel expects a Renderer returns a value immediately. So, it doesn't support remote calls of a server. You can set up a Renderer in code behind at the stage of GridPanel creation.

Well, if it were possible, it would mean that each cell makes a request to a server and a GridPanel waits for all the requests to be rendered. Well, I don't think it makes much sense.

I think it is a client side thing to render data, but, as I said, you can configure Renderers on server if needed, but before rendering a GridPanel.