Style in one column only if the cell's value is greater than 0

  1. #1

    [CLOSED]Style in one column only if the cell's value is greater than 0

    In my GridPanel, I have to set style in one column only if the cell's value is greater than 0. How can I do this? In the same column, I have a format float <Renderer Fn="Ext.util.Format.numberRenderer('.0,00 /i')" />. I try to put <Renderer Handler="if (value > 0) metadata.css = 'red-label'; return value;" />, but don't work the format float. If I apply one css Css="background-color:#FF8080;", all cells are the style. Follows my code:

    <ext:GridPanel ID="grdControleCredito" runat="server" Layout="Form" StripeRows="true" TrackMouseOver="true" Height="80" AutoScroll="true">[
    	<Store>
    		<ext:Store ID="Store2" runat="server">
    			<Reader>
    				<ext:JsonReader runat="server">
    					<Fields>
    						<ext:RecordField Name="VlrDevidoAtrasado" Type="Float" />
    					</Fields>
    				</ext:JsonReader>
    			</Reader>
    		</ext:Store>
    	</Store>
    	<ColumnModel ID="ToolbargrdControleCreditoColumnModel" runat="server">
    		<Columns>
                    	<ext:Column Header="Vlr Dev. Atrasado" Width="110" DataIndex="VlrDevidoAtrasado" Align="Right" Css="background-color:#FF8080;">
    				<Renderer Fn="Ext.util.Format.numberRenderer('.0,00 /i')" />
    			</ext:Column>
    		</Columns>
    	</ColumnModel>
    	<Plugins>
    		<ext:GridFilters ID="GridFilters1" runat="server" Local="true" FiltersText="Filtro">
    			<Filters>
    				<ext:NumericFilter DataIndex="VlrDevidoAtrasado" />
    			</Filters>
                    </ext:GridFilters>
    	</Plugins>
    	<SelectionModel>
    		<ext:RowSelectionModel ID="grdControleCreditoRowSelectionModel1" runat="server" />
    	</SelectionModel>
    </ext:GridPanel>Click image for larger version. 
    
    Name:	Grid.png 
    Views:	10 
    Size:	8.0 KB 
    ID:	11011
    Last edited by romeu; May 15, 2014 at 12:37 PM. Reason: [CLOSED]

Similar Threads

  1. Gridview column style
    By sedgar in forum 1.x Help
    Replies: 1
    Last Post: Aug 04, 2011, 2:16 PM
  2. [CLOSED] Multi Level Grid -> Column Headers css style and alignment
    By bsnezw in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Jun 16, 2011, 3:22 PM
  3. [CLOSED] Column header text style
    By Stefanaccio in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 03, 2011, 10:03 AM
  4. [CLOSED] Change Cell Style after row select
    By rthiney in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Dec 07, 2010, 11:48 PM
  5. Replies: 0
    Last Post: Feb 17, 2010, 5:38 AM

Posting Permissions