datagrid cell item color depending upon priority

1 view
Skip to first unread message

pramod ingole

unread,
Apr 9, 2010, 4:08:02 AM4/9/10
to flex_...@googlegroups.com
Hi All...
PHP return an xml , from which i creaded datagrid.

xml is:
 <raci>
 <raciitem>
  <responsible>6</responsible>
  <responsiblepriority>1</responsiblepriority>
  <accountable>8</accountable>
  <accountablepriority>3</accountablepriority>
  <consulted>2</consulted>
  <consultedpriority>2</consultedpriority>
  <inform>9</inform>
  <informpriority>4</informpriority>
  </raciitem>
<raciitem>
  <responsible>4</responsible>
  <responsiblepriority>1</responsiblepriority>
  <accountable>3</accountable>
  <accountablepriority>3</accountablepriority>
  <consulted>3</consulted>
  <consultedpriority>1</consultedpriority>
  <inform>8</inform>
  <informpriority>2</informpriority>
  </raciitem>

  </raci>

now i have to customize color of datagrid cell
depending upon priority
for example in above xml
"<responsible>6</responsible>" represent datagrid item value
and color depends upon its priority <responsiblepriority>1</responsiblepriority>.
if
responsiblepriority is 1 i have to set RED color, if 2 gray color, if  3 orange color and if 4 green color.
how to do this..?

i am using itemRenderer in datagrid column,
but while placing color to datagrid cell depending upon its priority i am getting problem....
it gives only single color to whole datagrid column...


Thanks in advance.
Pramod Ingole.

xelf

unread,
Apr 9, 2010, 5:59:47 AM4/9/10
to Flex India Community
Hi Pramod,
In-order achieve your requirement, do a conditional check inside
itemrenderer, check the value and assign color to it.
Set the color using some case block like that which will have default
color for the renderer.
Basically if you apply color for renderer it will be assigned only for
that cell and it should not be referred to datagrid column or cell.

I hope this will help you.

Thanks,
Sam

> if responsiblepriority is *1* i have to set RED color, if *2* gray color,
> if  *3* orange color and if* 4* green color.

Reply all
Reply to author
Forward
0 new messages