2008-06-25 [Revision #73, Version 0.6.0]
*NEW - Coolite Toolkit Version 0.7 now available for DOWNLOAD. See also Examples Explorer.
 

Coolite Forums

Welcome Guest ( Login | Register )
 
2008-06-25 [Revision #73, Version 0.6.0]
Subscribe
Last Login: Today @ 3:28:10 PM
Posts: 1,652,
Posted 6/25/2008 2:37:55 PM

Group: Core Development Team
  1. Changed GridPanel Renderer property to use new Renderer type.

    The following example demonstrates setting a custom Handler to check if a boolean value is 'true', then return 'Yes' or 'No'. The Handler is automatically wrapped in a function(){} template and the Column arguments are passed into the function.

    Example

    <ext:Column Header="Indoor?" DataIndex="Indoor" Sortable="true">
        <Renderer Handler="return (value) ? 'Yes':'No';" />
    </ext:Column>


    // arguments
    // "value", "metadata", "record", "rowIndex", "colIndex", "store"

    The following example demonstrates setting a custom function. The function is rendered as a raw value and no formatting is applied.

    Example

    <ext:Column Header="Availability" DataIndex="Availability">
        <Renderer Fn="Ext.util.Format.dateRenderer('Y-m-d')" />
    </ext:Column>


    The following example demonstrates setting one of the Renderer helper Formats. The Renderer helper Format are a list of pre-defined list of functions which wrap common formatting functionality.

    Example

    <ext:Column Header="Price" DataIndex="Price" Sortable="true">
        <Renderer Format="UsMoney" />
    </ext:Column>


    Other Format types include:

    None,
    Capitalize,
    Date,
    DateRenderer,
    DefaultValue,
    Ellipsis,
    FileSize,
    HtmlDecode,
    LowerCase,
    StripScripts,
    StripTags,
    Substr,
    Trim,
    Undef,
    Uppercase,
    UsMoney

    The following example demonstrates setting the Ellipsis Format and passing an extra argument to trim the description at 50 characters.

    Example

    <ext:Column Header="Description" DataIndex="description" Width="150">
        <Renderer Format="Ellipsis" FormatArgs="50" />
    </ext:Column>
--
Geoffrey McGill
Coolite Inc.
Development Team
Coolite Examples | Coolite API Docs | ExtJS API Docs
twitter [coolite | personal]
« Prev Topic | Next Topic »
Reading This Topic
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.
All times are GMT -8:00, Time now is 4:25pm