Hiding/Disabling images in a datagrid


hi,

 

i working on application park district's program management. have datagrid lists programs , contains 2 images; 1 editing program , 1 deleting program (both images in same column). xml in dataprovider contains number of participants in program currently. need hide delete image if number of participants greater 0.

 

here datagrid appears:

dg_preview.png

 

and code:

 

     <mx:datagrid stylename="datagrid" id="programgrid" dataprovider="{programlistarray}" width="100%" right="5" left="5">           <mx:columns>                <mx:datagridcolumn width="50" id="manage" datafield="item_id" headertext="" sortable="false">                     <mx:itemrenderer>                          <mx:component>                               <mx:hbox horizontalalign="center">                                    <mx:image tooltip="click here edit program type." click="outerdocument.showmanageprogram(data.item_id)" source="@embed(source='../new_interface_images/icons/window edit.png')"/>                                                                       <mx:image tooltip="click here delete program type." click="outerdocument.showdeleteconfirm(data.item_id)" source="@embed(source='../new_interface_images/icons/window delete.png')"/>                               </mx:hbox>                          </mx:component>                     </mx:itemrenderer>                </mx:datagridcolumn>                <mx:datagridcolumn sortable="false" width="300" id="namefield" datafield="item_name" headertext="program name"/>                <mx:datagridcolumn sortable="false" width="200" id="codefield" datafield="item_code" headertext="code"/>                <mx:datagridcolumn sortable="false" width="200" id="datefield" datafield="start_date" headertext="start"/>           </mx:columns>      </mx:datagrid> 

 

 

anyone have suggestions on easiest way check number of participants , disable or hide delete image?

 

here sample of xml:

<programlist>      <program>           <item_id>1</item_id>           <item_name>test program</item_name>           <item_code>00001</item_code>           <start_date>2010-04-01</start_date>           <participant_count>23</participant_count>      </program>       <program>           <item_id>2</item_id>           <item_name>test program 2</item_name>           <item_code>00002</item_code>           <start_date>2010-04-01</start_date>           <participant_count>0</participant_count>      </program>       <program>           <item_id>3</item_id>           <item_name>test program 3</item_name>           <item_code>00003</item_code>           <start_date>2010-04-01</start_date>           <participant_count>15</participant_count>      </program> </programlist> 

try adding visible='{data.participant_count>0}' hbox or component

 

-k



More discussions in Flex (Read Only)


adobe

Comments

Popular posts from this blog

Joomla site hacked, cant see front and - Joomla! Forum - community, help and support

Christian Home School Programs - Joomla! Forum - community, help and support

Trouble with PF_OutFlag_I_USE_AUDIO and PF_CHECKOUT_LAYER_AUDIO