|
Subscribe
|
- 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]
|
|
|
|