blob: 7c24027da0a9a1a47b161620eb313a1eabad4746 [file] [log] [blame]
{ "type": "class",
"qname": "spark.components.gridClasses.GridItemRenderer",
"baseClassname": "spark.components.Group"
,
"description": "The GridItemRenderer class defines the base class for custom item renderers for the Spark grid controls, such as DataGrid and Grid. Item renderers are only required to display column-specific aspects of their data. They are not responsible for displaying the selection or hover indicators, the alternating background color (if any), or row or column separators. <p>Item renderers are associated with each column of a grid. Set the item renderer for a column by using the <code>GridColumn.itemRenderer property</code>.</p> <p>By default, an item renderer does not clip to the boundaries of the cell. If your renderer extends past the bounds of the cell, you can set <code>clipAndEnableScrolling</code> to <code>true</code> to clip the renderer to the bounds of the cell.</p> <p>Transitions in DataGrid item renderers aren't supported. The GridItemRenderer class has disabled its <code>transitions</code> property so setting it will have no effect.</p> <p><b>Efficiency Considerations</b></p> <p>DataGrid scrolling and startup performance are directly linked to item renderer complexity and the number of item renderers that are visible within the DataGrid's scroller. Custom GridItemRenderer instances are used and reused repeatedly so it's important to define them as simply and efficiently as possible.</p> <p>If an item renderer's responsibility is limited to displaying one or more lines of text, then developers should seriously consider using the DefaultItemRenderer class which does so very economically (an application that's only going to be deployed on Windows one can gain some additional performance by using the UITextFieldGridItemRenderer class instead). The most efficient way to use GridItemRenderer to display the GridColumn's dataField as text is to identify the GridItemRenderer's text displaying element with <code>id=&quot;labelDisplay&quot;</code>. The labelDisplay component must be a <code>TextBase</code> subclass like <code>Label</code> or <code>RichText</code>. You might take this approach, instead of just using DefaultGridItemRenderer, if your item renderer included some additional elements that did not depend on the item renderer's data, like borders or other graphic elements.</p> <p>An item renderer that contains more than one visual element whose properties depend on the item renderer's data can use data binding to define the values of those properties. This approach yields MXML code that's straightforward to read and maintain and its performance may be adequate if the number of visible item renderers is limited (see the DataGrid <code>requestedRowCount</code> and <code>requestedColumnCount</code> properties). The most efficient way to configure this kind of item renderer is to override its <code>prepare()</code> method and do the work there. The renderer's <code>prepare()</code> method is called each time the renderer is redisplayed and so it's important that it's coded efficiently. If your item renderer is stateful, for example if it caches internal values, you can clear its state in its <code>discard()</code> method. The <code>discard()</code> method is called each time the renderer is moved to the DataGrid's internal free list, where it's available for reuse.</p> <p>GridItemRenderers should be as simple as possible. To gain the best possible performance, minimize the number of components, and the depth of the hierarchy. If it's practical, use explicit positions and sizes rather than constraints to define the layout. DataGrid's with <code>variableRowHeight=&quot;false&quot;</code> (the default) tend to perform better, likewise for <code>showDataTips=&quot;false&quot;</code> (the default) and <code>clipAndEnableScrolling=&quot;false&quot;</code> (the default).</p> <p>Examples of the various GridItemRenderer configurations described here are available in the examples section.</p>",
"tags": [
{ "tagName": "includeExample",
"values": ["examples/GridItemRendererExample.mxml", "examples/GridItemRendererCustomBindingExample.mxml", "examples/GridItemRendererCustomPrepareExample.mxml"]},
{ "tagName": "see",
"values": ["spark.components.DataGrid", "spark.components.Grid", "spark.components.gridClasses.GridColumn", "spark.components.gridClasses.GridColumn#itemRenderer", "spark.skins.spark.DefaultGridItemRenderer"]},
{ "tagName": "playerversion",
"values": ["Flash 10", "AIR 2.5"]},
{ "tagName": "productversion",
"values": ["Flex 4.5"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"members": [
{ "type": "method",
"qname": "initializeRendererToolTip",
"namespace": "mx_internal",
"bindable": [],
"details": ["static"],
"deprecated": {},
"description": "If the effective value of showDataTips has changed for this column, then set the renderer's toolTip property to a placeholder. The real tooltip text is computed in the TOOL_TIP_SHOW handler below.",
"return": "void",
"params": [{ "name": "renderer", "type": "spark.components.gridClasses.IGridItemRenderer"}]}
,
{ "type": "method",
"qname": "toolTipShowHandler",
"namespace": "mx_internal",
"bindable": [],
"details": ["static"],
"deprecated": {},
"description": "Shows the tooltip for one of the grid's item renderers. This is the handler for the <code>ToolTipEvent.TOOL_TIP_SHOW</code> event in GridItemRenderer, DefaultGridItemRenderer, and UITextFieldGridItemRenderer which are installed by the corresponding constructors. The item renderer's tool tip is computed just before it is shown. If the item renderer's column <code>showDataTips<code> property is true, a placeholder tool tip is registered with the tool tip manager so that mouse handlers are put in place to detect when the tool tip should be shown by calling this handler. This handler replaces the placeholder text with the actual text and resizes the tooltip before moving it into position. The tip is positioned over the item renderer with the origin of the tip at 0, 0, after accounting for the layoutDirection of the grid. The current target is expected to implement IGridItemRenderer and IUIComponent.",
"return": "void",
"params": [{ "name": "event", "type": "mx.events.ToolTipEvent"}]}
,
{ "type": "method",
"qname": "spark.components.gridClasses.GridItemRenderer",
"namespace": "",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Constructor.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10", "AIR 2.5"]},
{ "tagName": "productversion",
"values": ["Flex 4.5"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "",
"params": []}
,
{ "type": "accessor",
"access": "read-only",
"return": "Number",
"qname": "baselinePosition",
"namespace": "public",
"bindable": [],
"details": ["override"],
"deprecated": {},
"description": "",
"tags": [
{ "tagName": "private",
"values": []} ]},
{ "type": "accessor",
"access": "read-write",
"return": "spark.components.gridClasses.GridColumn",
"qname": "column",
"namespace": "public",
"bindable": ["columnChanged"],
"details": [],
"deprecated": {},
"description": "<p>The Grid's <code>updateDisplayList()</code> method sets this property before calling <code>preprare()</code></p>.",
"tags": [
{ "tagName": "inheritDoc",
"values": []},
{ "tagName": "default",
"values": ["null"]},
{ "tagName": "playerversion",
"values": ["Flash 10", "AIR 2.5"]},
{ "tagName": "productversion",
"values": ["Flex 4.5"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-only",
"return": "int",
"qname": "columnIndex",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "",
"tags": [
{ "tagName": "inheritDoc",
"values": [""]},
{ "tagName": "playerversion",
"values": ["Flash 10", "AIR 2.5"]},
{ "tagName": "productversion",
"values": ["Flex 4.5"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-write",
"return": "Object",
"qname": "data",
"namespace": "public",
"bindable": ["dataChange"],
"details": [],
"deprecated": {},
"description": "The value of the data provider item for the grid row corresponding to the item renderer. This value corresponds to the object returned by a call to the <code>dataProvider.getItemAt(rowIndex)</code> method. <p>Item renderers can override this property definition to access the data for the entire row of the grid. </p>",
"tags": [
{ "tagName": "default",
"values": ["null"]},
{ "tagName": "playerversion",
"values": ["Flash 10", "AIR 2.5"]},
{ "tagName": "productversion",
"values": ["Flex 4.5"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-write",
"return": "Boolean",
"qname": "down",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "",
"tags": [
{ "tagName": "inheritDoc",
"values": []},
{ "tagName": "default",
"values": ["false"]},
{ "tagName": "playerversion",
"values": ["Flash 10", "AIR 2.5"]},
{ "tagName": "productversion",
"values": ["Flex 4.5"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-only",
"return": "spark.components.Grid",
"qname": "grid",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Returns the Grid associated with this item renderer. This is the same value as <code>column.grid</code>.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10", "AIR 2.5"]},
{ "tagName": "productversion",
"values": ["Flex 4.5"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-write",
"return": "Boolean",
"qname": "hovered",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "",
"tags": [
{ "tagName": "inheritDoc",
"values": []},
{ "tagName": "default",
"values": ["false"]},
{ "tagName": "playerversion",
"values": ["Flash 10", "AIR 2.5"]},
{ "tagName": "productversion",
"values": ["Flex 4.5"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-write",
"return": "int",
"qname": "rowIndex",
"namespace": "public",
"bindable": ["rowIndexChanged"],
"details": [],
"deprecated": {},
"description": "<p>The Grid's <code>updateDisplayList()</code> method sets this property before calling <code>prepare()</code></p>.",
"tags": [
{ "tagName": "inheritDoc",
"values": []},
{ "tagName": "default",
"values": ["-1"]},
{ "tagName": "playerversion",
"values": ["Flash 10", "AIR 2.5"]},
{ "tagName": "productversion",
"values": ["Flex 4.5"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-write",
"return": "Boolean",
"qname": "showsCaret",
"namespace": "public",
"bindable": ["showsCaretChanged"],
"details": [],
"deprecated": {},
"description": "<p>The Grid's <code>updateDisplayList()</code> method sets this property before calling <code>preprare()</code></p>.",
"tags": [
{ "tagName": "inheritDoc",
"values": []},
{ "tagName": "default",
"values": ["false"]},
{ "tagName": "playerversion",
"values": ["Flash 10", "AIR 2.5"]},
{ "tagName": "productversion",
"values": ["Flex 4.5"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-write",
"return": "Boolean",
"qname": "selected",
"namespace": "public",
"bindable": ["selectedChanged"],
"details": [],
"deprecated": {},
"description": "<p>The Grid's <code>updateDisplayList()</code> method sets this property before calling <code>preprare()</code></p>.",
"tags": [
{ "tagName": "inheritDoc",
"values": []},
{ "tagName": "default",
"values": ["false"]},
{ "tagName": "playerversion",
"values": ["Flash 10", "AIR 2.5"]},
{ "tagName": "productversion",
"values": ["Flex 4.5"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-write",
"return": "Boolean",
"qname": "dragging",
"namespace": "public",
"bindable": ["draggingChanged"],
"details": [],
"deprecated": {},
"description": "",
"tags": [
{ "tagName": "inheritDoc",
"values": []},
{ "tagName": "playerversion",
"values": ["Flash 10", "AIR 2.5"]},
{ "tagName": "productversion",
"values": ["Flex 4.5"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-write",
"return": "String",
"qname": "label",
"namespace": "public",
"bindable": ["labelChanged"],
"details": [],
"deprecated": {},
"description": "",
"tags": [
{ "tagName": "default",
"values": [""""]},
{ "tagName": "playerversion",
"values": ["Flash 10", "AIR 2.5"]},
{ "tagName": "copy",
"values": ["IGridItemRenderer#label"]},
{ "tagName": "productversion",
"values": ["Flex 4.5"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-write",
"return": "spark.components.supportClasses.TextBase",
"qname": "labelDisplay",
"namespace": "public",
"bindable": ["labelDisplayChanged"],
"details": [],
"deprecated": {},
"description": "An optional visual component in the item renderer for displaying the <code>label</code> property. If you use this property to specify a visual component, the component's <code>text</code> property is kept synchronized with the item renderer's <code>label</code> property.",
"tags": [
{ "tagName": "default",
"values": ["null"]},
{ "tagName": "playerversion",
"values": ["Flash 10", "AIR 2.5"]},
{ "tagName": "productversion",
"values": ["Flex 4.5"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "method",
"qname": "getCurrentRendererState",
"namespace": "protected",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Returns the name of the state to be applied to the renderer. For example, a basic item renderer returns the String &quot;normal&quot;, &quot;hovered&quot;, or &quot;selected&quot; to specify the renderer's state. If dealing with touch interactions (or mouse interactions where selection is ignored), &quot;down&quot; and &quot;downAndSelected&quot; can also be returned. <p>A subclass of GridItemRenderer must override this method to return a value if the behavior desired differs from the default behavior.</p> <p>In Flex 4.0, the 3 main states were &quot;normal&quot;, &quot;hovered&quot;, and &quot;selected&quot;. In Flex 4.5, &quot;down&quot; and &quot;downAndSelected&quot; have been added.</p> <p>The full set of states supported (in order of precedence) are: <ul> <li>dragging</li> <li>downAndSelected</li> <li>selectedAndShowsCaret</li> <li>hoveredAndShowsCaret</li> <li>normalAndShowsCaret</li> <li>down</li> <li>selected</li> <li>hovered</li> <li>normal</li> </ul> </p>",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10", "AIR 2.5"]},
{ "tagName": "productversion",
"values": ["Flex 4.5"]},
{ "tagName": "return",
"values": ["A String specifying the name of the state to apply to the renderer."]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "String",
"params": []}
,
{ "type": "method",
"qname": "prepare",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "",
"tags": [
{ "tagName": "inheritDoc",
"values": []},
{ "tagName": "playerversion",
"values": ["Flash 10", "AIR 2.5"]},
{ "tagName": "productversion",
"values": ["Flex 4.5"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "void",
"params": [{ "name": "hasBeenRecycled", "type": "Boolean"}]}
,
{ "type": "method",
"qname": "discard",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "",
"tags": [
{ "tagName": "inheritDoc",
"values": []},
{ "tagName": "playerversion",
"values": ["Flash 10", "AIR 2.5"]},
{ "tagName": "productversion",
"values": ["Flex 4.5"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "void",
"params": [{ "name": "willBeRecycled", "type": "Boolean"}]}
]
,
"events": [
{ "qname": "dataChange",
"type": "mx.events.FlexEvent"
,
"description": "Dispatched when the <code>data</code> property changes.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10", "AIR 2.5"]},
{ "tagName": "eventType",
"values": ["mx.events.FlexEvent.DATA_CHANGE"]},
{ "tagName": "productversion",
"values": ["Flex 4.5"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]}]
}