Clear Up
SharpKit Reference

DataItem Class

Namespace: Ext.dataview

Base Types

System.Object

Constructors

Properties

Name Description
extend A DataItem is a container for {@link Ext.dataview.ComponentView ComponentViews}. It ties together {@link Ext.data.Model records} to its contained Components via a {@link #dataMap dataMap} configuration. * For example, lets say you have a `text configuration which, when applied, gets turned into an instance of an Ext.Component. We want to update the {@link #html} of a sub-component when the 'text' field of the record gets changed. As you can see below, it is simply a matter of setting the key of the object to be the getter of the config (getText), and then give that property a value of an object, which then has 'setHtml' (the html setter) as the key, and 'text' (the field name) as the value. You can continue this for a as many sub-components as you wish. * dataMap: { // When the record is updated, get the text configuration, and // call {@link #setHtml} with the 'text' field of the record. getText: { setHtml: 'text' }, * // When the record is updated, get the userName configuration, and // call {@link #setHtml} with the 'from_user' field of the record. getUserName: { setHtml: 'from_user' }, * // When the record is updated, get the avatar configuration, and // call `setSrc` with the 'profile_image_url' field of the record. getAvatar: { setSrc: 'profile_image_url' } },
xtype A DataItem is a container for {@link Ext.dataview.ComponentView ComponentViews}. It ties together {@link Ext.data.Model records} to its contained Components via a {@link #dataMap dataMap} configuration. * For example, lets say you have a `text configuration which, when applied, gets turned into an instance of an Ext.Component. We want to update the {@link #html} of a sub-component when the 'text' field of the record gets changed. As you can see below, it is simply a matter of setting the key of the object to be the getter of the config (getText), and then give that property a value of an object, which then has 'setHtml' (the html setter) as the key, and 'text' (the field name) as the value. You can continue this for a as many sub-components as you wish. * dataMap: { // When the record is updated, get the text configuration, and // call {@link #setHtml} with the 'text' field of the record. getText: { setHtml: 'text' }, * // When the record is updated, get the userName configuration, and // call {@link #setHtml} with the 'from_user' field of the record. getUserName: { setHtml: 'from_user' }, * // When the record is updated, get the avatar configuration, and // call `setSrc` with the 'profile_image_url' field of the record. getAvatar: { setSrc: 'profile_image_url' } },

Methods

Name Description
initialize()
onDoubleTap(object)
onSwipe(object)
onTap(object)
onTouchEnd(object)
onTouchMove(object)
onTouchStart(object)
updateRecord(object) Updates this container's child items, passing through the dataMap. @param newRecord @private
© Copyright 2005-2011 SharpKit. All rights reserved.