Ext.List
Hierarchy
Files
A mechanism for displaying data using a list layout template. List uses an Ext.XTemplate as its internal templating mechanism, and is bound to an Ext.data.Store so that as the data in the store changes the view is automatically updated to reflect the changes.
The view also provides built-in behavior for many common events that can occur for its contained items including itemtap, containertap, etc. as well as a built-in selection model. In order to use these features, an itemSelector config must be provided for the DataView to determine what nodes it will be working with.
Useful Properties
Useful Methods
Useful Events
Screenshot:

Example code:
Ext.regModel('Contact', {
fields: ['firstName', 'lastName']
});
var store = new Ext.data.JsonStore({
model : 'Contact',
sorters: 'lastName',
getGroupString : function(record) {
return record.get('lastName')[0];
},
data: [
{firstName: 'Tommy', lastName: 'Maintz'},
{firstName: 'Rob', lastName: 'Dougan'},
{firstName: 'Ed', lastName: 'Spencer'},
{firstName: 'Jamie', lastName: 'Avins'},
{firstName: 'Aaron', lastName: 'Conran'},
{firstName: 'Dave', lastName: 'Kaneda'},
{firstName: 'Michael', lastName: 'Mullany'},
{firstName: 'Abraham', lastName: 'Elias'},
{firstName: 'Jay', lastName: 'Robinson'}
]
});
var list = new Ext.List({
fullscreen: true,
itemTpl : '{firstName} {lastName}',
grouped : true,
indexBar: true,
store: store
});
list.show();
Available since: 1.1.0
Config options
Only respected if singleSelect is true. If this is set to false, a selected item will not be deselected when tapped on, ensuring that once an item has been selected at least one item will always be selected. Defaults to allowed (true).
Defaults to: true
Available since: 1.1.0
The base CSS class to apply to this components's element. This will also be prepended to elements within this component like Panel's body will get a class x-panel-body. This means that if you create a subclass of Panel, and you want it to get all the Panels styling for the element and the body, you leave the baseCls x-panel and use componentCls to add specific styling for this component.
Defaults to: 'x-component'
Available since: 1.1.0
Set this to true to ignore datachanged events on the bound store. This is useful if you wish to provide custom transition animations via a plugin (defaults to false)
Defaults to: false
Available since: 1.1.0
Specifies the border for this component. The border can be a single numeric value to apply to all sides or it can be a CSS style specification for each style, for example: '10 5 3 10'.
Available since: 1.1.0
Center the Component. Defaults to false.
Defaults to: false
Available since: 1.1.0
True to clear any selections on the list when the list is deactivated (defaults to true).
Defaults to: true
Available since: 1.1.0
An optional extra CSS class that will be added to this component's Element (defaults to ''). This can be useful for adding customized styles to the component or any of its children using standard CSS rules.
Available since: 1.1.0
CSS Class to be added to a components root level element to give distinction to it via styling.
Defaults to: 'x-list'
Available since: 1.1.0
Overrides: Ext.lib.Component.componentCls
The sizing and positioning of the component Elements is the responsibility of
the Component's layout manager which creates and manages the type of layout specific to the component.
If the layout configuration is not explicitly specified for a general purpose compopnent the default layout manager will be used.
Available since: 1.1.0
Optional. Specify an existing HTML element, or the id of an existing HTML element to use as the content
for this component.
- Description :
This config option is used to take an existing HTML element and place it in the layout element of a new component (it simply moves the specified DOM element after the Component is rendered to use as the content.
- Notes :
The specified HTML element is appended to the layout element of the component after any configured HTML has been inserted, and so the document will not contain this element at the time the render event is fired.The specified HTML element used will not participate in any
layoutscheme that the Component may use. It is just HTML. Layouts operate on childitems.Add either thex-hiddenor thex-hide-displayCSS class to prevent a brief flicker of the content before it is rendered to the panel.
Available since: 1.1.0
True to defer emptyText being applied until the store's first load
Defaults to: true
Available since: 1.1.0
true to disable selection within the DataView. Defaults to false. This configuration will lock the selection model that the DataView uses.
Available since: 1.1.0
Defaults to false.
Defaults to: false
Available since: 1.1.0
CSS class to add when the Component is disabled. Defaults to 'x-item-disabled'.
Defaults to: 'x-item-disabled'
Available since: 1.1.0
Allows the component to be dragged via the touch event.
Allows the component to be dragged via the touch event.
Available since: 1.1.0
The text to display in the view when there is no data to display (defaults to '').
Defaults to: ""
Available since: 1.1.0
Create the Component as a floating and use absolute positioning. Defaults to false.
Defaults to: false
Available since: 1.1.0
The class that is being added to this component when its floating. (defaults to x-floating)
Defaults to: 'x-floating'
Available since: 1.1.0
Force the component to take up 100% width and height available. Defaults to false. Setting this configuration immediately sets the monitorOrientation config to true. Setting this to true will render the component instantly.
Defaults to: false
Available since: 1.1.0
True to group the list items together (defaults to false). When using grouping, you must specify a method getGroupString on the store so that grouping can be maintained.
Ext.regModel('Contact', {
fields: ['firstName', 'lastName']
});
var store = new Ext.data.JsonStore({
model : 'Contact',
sorters: 'lastName',
getGroupString : function(record) {
// Group by the last name
return record.get('lastName')[0];
},
data: [
{firstName: 'Tommy', lastName: 'Maintz'},
{firstName: 'Rob', lastName: 'Dougan'},
{firstName: 'Ed', lastName: 'Spencer'},
{firstName: 'Jamie', lastName: 'Avins'},
{firstName: 'Aaron', lastName: 'Conran'},
{firstName: 'Dave', lastName: 'Kaneda'},
{firstName: 'Michael', lastName: 'Mullany'},
{firstName: 'Abraham', lastName: 'Elias'},
{firstName: 'Jay', lastName: 'Robinson'},
{firstName: 'Tommy', lastName: 'Maintz'},
{firstName: 'Rob', lastName: 'Dougan'},
{firstName: 'Ed', lastName: 'Spencer'},
{firstName: 'Jamie', lastName: 'Avins'},
{firstName: 'Aaron', lastName: 'Conran'},
{firstName: 'Dave', lastName: 'Kaneda'},
{firstName: 'Michael', lastName: 'Mullany'},
{firstName: 'Abraham', lastName: 'Elias'},
{firstName: 'Jay', lastName: 'Robinson'}
]
});
Defaults to: false
Available since: 1.1.0
The height of this component in pixels.
The height of this component in pixels.
Available since: 1.1.0
True to automatically bind a tap listener to the mask that hides the window. Defaults to true. Note: if you set this property to false you have to programmaticaly hide the overlay.
Defaults to: true
Available since: 1.1.0
An HTML fragment, or a DomHelper specification to use as the layout element content (defaults to ''). The HTML content is added after the component is rendered, so the document will not contain this HTML at the time the render event is fired. This content is inserted into the body before any configured contentEl is appended.
Available since: 1.1.0
True to render an alphabet IndexBar docked on the right. This can also be a config object that will be passed to Ext.IndexBar (defaults to false)
Defaults to: false
Available since: 1.1.0
An additional class that will be added to each item in the List. Defaults to ''.
Defaults to: ''
Available since: 1.1.0
@required This is a required setting. A simple CSS selector (e.g. div.some-class or span:first-child) that will be used to determine what nodes this DataView will be working with.
Available since: 1.1.0
The inner portion of the item template to be rendered. Follows an XTemplate structure and will be placed inside of a tpl for in the tpl configuration.
Available since: 1.1.0
Set this to true to automatically relayout this component on orientation change. This property is set to true by default if a component is floating unless you specifically set this to false. Also note that you dont have to set this property to true if this component is a child of a fullscreen container, since fullscreen components are also laid out automatically on orientation change. Defaults to null
Available since: 1.1.0
(optional)
A config object containing one or more event handlers to be added to this object during initialization. This should be a valid listeners config object as specified in the addListener example for attaching multiple handlers at once.
DOM events from ExtJs Components
While some ExtJs Component classes export selected DOM events (e.g. "click", "mouseover" etc), this
is usually only done when extra value can be added. For example the DataView's
click event passing the node clicked on. To access DOM
events directly from a child element of a Component, we need to specify the element option to
identify the Component property to add a DOM listener to:
new Ext.Panel({
width: 400,
height: 200,
dockedItems: [{
xtype: 'toolbar'
}],
listeners: {
click: {
element: 'el', //bind to the underlying el property on the panel
fn: function(){ console.log('click el'); }
},
dblclick: {
element: 'body', //bind to the underlying body property on the panel
fn: function(){ console.log('dblclick body'); }
}
}
});
Available since: 1.1.0
A string to display during data load operations (defaults to undefined). If specified, this text will be displayed in a loading div and the view's contents will be cleared while loading, otherwise the view's contents will continue to display normally until the new data is loaded and the contents are replaced.
Defaults to: 'Loading...'
Available since: 1.1.0
Specifies the margin for this component. The margin can be a single numeric value to apply to all sides or it can be a CSS style specification for each style, for example: '10 5 3 10'.
Available since: 1.1.0
The maximum value in pixels which this Component will set its height to.
Warning: This will override any size management applied by layout managers.
Available since: 1.1.0
The maximum value in pixels which this Component will set its width to.
Warning: This will override any size management applied by layout managers.
Available since: 1.1.0
The minimum value in pixels which this Component will set its height to.
Warning: This will override any size management applied by layout managers.
Available since: 1.1.0
The minimum value in pixels which this Component will set its width to.
Warning: This will override any size management applied by layout managers.
Available since: 1.1.0
True to make the Component modal and mask everything behind it when displayed, false to display it without restricting access to other UI elements (defaults to false).
Defaults to: false
Available since: 1.1.0
Monitor Orientation change
Defaults to: false
Available since: 1.1.0
True to allow selection of more than one item at a time, false to allow selection of only a single item at a time or no selection at all, depending on the value of singleSelect (defaults to false).
Available since: 1.1.0
True to display a disclosure icon on each list item. This won't bind a listener to the tap event. The list will still fire the disclose event though. By setting this config to a function, it will automatically add a tap event listeners to the disclosure buttons which will fire your function. Finally you can specify an object with a 'scope' and 'handler' property defined. This will also be bound to the tap event listener and is useful when you want to change the scope of the handler.
Defaults to: false
Available since: 1.1.0
A CSS class to apply to each item in the view on mouseover (defaults to undefined).
A CSS class to apply to each item in the view on mouseover (defaults to undefined).
Available since: 1.1.0
Specifies the padding for this component. The padding can be a single numeric value to apply to all sides or it can be a CSS style specification for each style, for example: '10 5 3 10'.
Available since: 1.1.0
Whether or not to pin headers on top of item groups while scrolling for an iPhone native list experience. Defaults to false on Android and Blackberry (for performance reasons) Defaults to true on other devices.
Available since: 1.1.0
An object or array of objects that will provide custom functionality for this component. The only requirement for a valid plugin is that it contain an init method that accepts a reference of type Ext.Component. When a component is created, if any plugins are available, the component will call the init method on each plugin, passing a reference to itself. Each plugin can then call methods or respond to events on the component as needed to provide its functionality.
Available since: 1.1.0
A CSS class to apply to an item on the view while it is being pressed (defaults to 'x-item-pressed').
Defaults to: "x-item-pressed"
Available since: 1.1.0
The amount of delay between the tapstart and the moment we add the pressedCls. Settings this to true defaults to 100ms
Defaults to: 100
Available since: 1.1.0
True to prevent the item selection when the user taps a disclose icon. Defaults to true
Defaults to: true
Available since: 1.1.0
An object containing properties specifying DomQuery selectors which identify child elements created by the render process.
After the Component's internal structure is rendered according to the renderTpl, this object is iterated through,
and the found Elements are added as properties to the Component using the renderSelector property name.
For example, a Component which rendered an image, and description into its element might use the following properties coded into its prototype:
renderTpl: '<img src="{imageUrl}" class="x-image-component-img"><div class="x-image-component-desc">{description}</div>',
renderSelectors: {
image: 'img.x-image-component-img',
descEl: 'div.x-image-component-desc'
}
After rendering, the Component would have a property image referencing its child img Element,
and a property descEl referencing the div Element which contains the description.
Available since: 1.1.0
Specify the id of the element, a DOM element or an existing Element that this component will be rendered into.
- Notes : Do not use this option if the Component is to be a child item of a Container. It is the responsibility of the Container's layout manager to render and manage its child items.When using this config, a call to render() is not required.
See render also.
Available since: 1.1.0
An XTemplate used to create the internal structure inside this Component's encapsulating Element.
You do not normally need to specify this. For the base classes Ext.Component
and Ext.Container, this defaults to null which means that they will be initially rendered
with no internal structure; they render their Element empty. The more specialized ExtJS and Touch classes
which use a more complex DOM structure, provide their own template definitions.
This is intended to allow the developer to create application-specific utility Components with customized internal structure.
Upon rendering, any created child elements may be automatically imported into object properties using the renderSelectors option.
Defaults to: ['<tpl if="grouped"><h3 class="x-list-header x-list-header-swap x-hidden-display"></h3></tpl>']
Available since: 1.1.0
Overrides: Ext.lib.Component.renderTpl
Configure the component to be scrollable. Acceptable values are:
- 'horizontal', 'vertical', 'both' to enabling scrolling for that direction.
- A Scroller configuration.
- false to explicitly disable scrolling.
Enabling scrolling immediately sets the monitorOrientation config to true (for Panel)
Available since: 1.1.0
A CSS class to apply to each selected item in the view (defaults to 'x-view-selected').
Defaults to: "x-item-selected"
Available since: 1.1.0
The type of animation you want to use when this component is shown. If you set this this hide animation will automatically be the opposite.
Available since: 1.1.0
True to enable multiselection by clicking on multiple items without requiring the user to hold Shift or Ctrl, false to force the user to hold Ctrl or Shift to select more than on item (defaults to false).
Available since: 1.1.0
True to allow selection of exactly one item at a time, false to allow no selection at all (defaults to false). Note that if multiSelect = true, this value will be ignored.
Available since: 1.1.0
True to stop the event that fires when you click outside the floating component. Defalts to true.
Defaults to: true
Available since: 1.1.0
@required The Ext.data.Store to bind this DataView to.
@required The Ext.data.Store to bind this DataView to.
Available since: 1.1.0
A custom style specification to be applied to this component's Element. Should be a valid argument to Ext.Element.applyStyles.
new Ext.Panel({
title: 'Some Title',
renderTo: Ext.getBody(),
width: 400, height: 300,
layout: 'form',
items: [{
xtype: 'textareafield',
style: {
width: '95%',
marginBottom: '10px'
}
},
new Ext.Button({
text: 'Send',
minWidth: '100',
style: {
marginBottom: '10px'
}
})
]
});
Available since: 1.1.0
The class that is added to the content target when you set styleHtmlContent to true. Defaults to 'x-html'
Defaults to: 'x-html'
Available since: 1.1.0
True to automatically style the html inside the content target of this component (body for panels). Defaults to false.
Defaults to: false
Available since: 1.1.0
@required The HTML fragment or an array of fragments that will make up the template used by this DataView. This should be specified in the same format expected by the constructor of Ext.XTemplate.
Available since: 1.1.0
Overrides: Ext.lib.Component.tpl
The Ext.(X)Template method to use when
updating the content area of the Component. Defaults to 'overwrite'
(see Ext.XTemplate.overwrite).
Defaults to: 'overwrite'
Available since: 1.1.0
True to enable mouseenter and mouseleave events
Defaults to: false
Available since: 1.1.0
Defaults to 'singletap'. Other valid options are 'tap'
Defaults to: 'singletap'
Available since: 1.1.0
A set of predefined ui styles for individual components.
Most components support 'light' and 'dark'.
Extra string added to the baseCls with an extra '-'.
new Ext.Panel({
title: 'Some Title',
baseCls: 'x-component'
ui: 'green'
});
The ui configuration in this example would add 'x-component-green' as an additional class.
Available since: 1.1.0
The width of this component in pixels.
The width of this component in pixels.
Available since: 1.1.0
Properties
Read-only property indicating whether or not the component can be dragged
Defaults to: false
Available since: 1.1.0
Defaults to: /^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate|element|vertical|horizontal)$/
Available since: 1.1.0
Defaults to: ['<tpl for=".">', '<div class="x-list-group x-group-{id}">', '<h3 class="x-list-header">{group}</h3>', '<div class="x-list-group-items">', '{items}', '</div>', '</div>', '</tpl>']
Available since: 1.1.0
Read-only property indicating whether or not the component has been rendered.
Defaults to: false
Available since: 1.1.0
Methods
Create a new List
Available since: 1.1.0
Parameters
- config : Object
The config object
Returns
Overrides: Ext.DataView.constructor
Adds a CSS class to the top level element representing this component.
Available since: 1.1.0
Returns
- Ext.Component
Returns the Component to allow method chaining.
Adds the specified events to the list of events which this Observable may fire.
Available since: 1.1.0
Parameters
- o : Object|String
Either an object with event names as properties with a value of
trueor the first event name string if multiple event names are being passed as separate parameters. - Optional : string
. Event name if multiple event names are being passed as separate parameters. Usage:
this.addEvents('storeloaded', 'storecleared');
Appends an event handler to this object.
Available since: 1.1.0
Parameters
- eventName : String
The name of the event to listen for. May also be an object who's property names are event names. See
- handler : Function
The method the event invokes.
- scope : Object (optional)
The scope (
thisreference) in which the handler function is executed. If omitted, defaults to the object which fired the event. - options : Object (optional)
An object containing handler configuration. properties. This may contain any of the following properties:
- scope : ObjectThe scope (
thisreference) in which the handler function is executed. If omitted, defaults to the object which fired the event. - delay : NumberThe number of milliseconds to delay the invocation of the handler after the event fires.
- single : BooleanTrue to add a handler to handle just the next firing of the event, and then remove itself.
- buffer : NumberCauses the handler to be scheduled to run in an Ext.util.DelayedTask delayed by the specified number of milliseconds. If the event fires again within that time, the original handler is not invoked, but the new handler is scheduled in its place.
- target : ObservableOnly call the handler if the event was fired on the target Observable, not if the event was bubbled up from a child Observable.
- element : StringThis option is only valid for listeners bound to Components. The name of a Component property which references an element to add a listener to.
This option is useful during Component construction to add DOM event listeners to elements of Components which will exist only after the Component is rendered. For example, to add a click listener to a Panel's body:
new Ext.Panel({ title: 'The title', listeners: { click: this.handlePanelClick, element: 'body' } });When added in this way, the options available are the options applicable to Ext.Element.addListener
Combining Options
Using the options argument, it is possible to combine different types of listeners:
A delayed, one-time listener.myPanel.on('hide', this.handleClick, this, { single: true, delay: 100 });Attaching multiple handlers in 1 call
The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:
.myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); - scope : Object
Overrides: Ext.util.Observable.addListener
Adds listeners to any Observable object (or Element) which are automatically removed when this Component is destroyed.
Available since: 1.1.0
Parameters
- item : Observable|Element
The item to which to add a listener/listeners.
- ename : Object|String
The event name, or an object containing event name properties.
- fn : Function
Optional. If the
enameparameter was an event name, this is the handler function. - scope : Object
Optional. If the
enameparameter was an event name, this is the scope (thisreference) in which the handler function is executed. - opt : Object
Optional. If the
enameparameter was an event name, this is the addListener options.
Available since: 1.1.0
Overrides: Ext.Component.afterComponentLayout
Available since: 1.1.0
Parameters
- alignTo : Object
- allowSides : Object
- offset : Object
Sets references to elements inside the component. E.g body -> x-panel-body
Available since: 1.1.0
Changes the data store bound to this view and refreshes it.
Available since: 1.1.0
Parameters
- store : Store
The store to bind to this view
Removes all listeners for this object including the managed listeners
Available since: 1.1.0
Removes all managed listeners for this object.
Available since: 1.1.0
Function which can be overridden which returns the data object passed to this DataView's template to render the whole DataView.
This is usually an Array of data objects, each element of which is processed by an XTemplate which uses '<tpl for=".">' to iterate over its supplied data object as an Array. However, named properties may be placed into the data object to provide non-repeating data such as headings, totals etc.
Available since: 1.1.0
Parameters
- records : Array
An Array of Ext.data.Models to be rendered into the DataView.
- startIndex : Number
the index number of the Record being prepared for rendering.
Returns
- Array
An Array of data objects to be processed by a repeating XTemplate. May also contain named properties.
Overrides: Ext.DataView.collectData
Deselects a record instance by record instance or index.
Available since: 1.1.0
Parameters
- records : Ext.data.Record/Index
An array of records or an index
- suppressEvent : Boolean
Set to false to not fire a deselect event
Disable the component.
Available since: 1.1.0
Parameters
- silent : Boolean
Passing true, will supress the 'disable' event from being fired.
Returns
This method needs to be called whenever you change something on this component that requires the components layout to be recalculated. An example is adding, showing or hiding a docked item to a Panel, or changing the label of a form field. After a component layout, the container layout will automatically be run. So you could be on the safe side and always call doComponentLayout instead of doLayout.
Available since: 1.1.0
Parameters
- width : Object
- height : Object
- isSetSize : Object
Returns
- Ext.Container
this
private
Available since: 1.1.0
Parameters
- el : Object
- options : Object
Enable the component
Available since: 1.1.0
Parameters
- silent : Boolean
Passing false will supress the 'enable' event from being fired.
Returns
Enables events fired by this Observable to bubble up an owner hierarchy by calling
this.getBubbleTarget() if present. There is no implementation in the Observable base class.
This is commonly used by Ext.Components to bubble events to owner Containers. See Ext.Component.getBubbleTarget. The default implementation in Ext.Component returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.
Example:
Ext.override(Ext.form.Field, {
// Add functionality to Field's initComponent to enable the change event to bubble
initComponent : Ext.createSequence(Ext.form.Field.prototype.initComponent, function() {
this.enableBubble('change');
}),
// We know that we want Field's events to bubble directly to the FormPanel.
getBubbleTarget : function() {
if (!this.formPanel) {
this.formPanel = this.findParentByType('form');
}
return this.formPanel;
}
});
var myForm = new Ext.formPanel({
title: 'User Details',
items: [{
...
}],
listeners: {
change: function() {
// Title goes red if form has been modified.
myForm.header.setStyle('color', 'red');
}
}
});
Available since: 1.1.0
Parameters
- events : String/Array
The event name to bubble, or an Array of event names.
Returns the template node the passed child belongs to, or null if it doesn't belong to one.
Available since: 1.1.0
Parameters
- node : HTMLElement
Returns
- HTMLElement
The template node
Returns the template node by the Ext.EventObject or null if it is not found.
Available since: 1.1.0
Parameters
- e : Ext.EventObject
Fires the specified event with the passed parameters (minus the event name).
An event may be set to bubble up an Observable parent hierarchy (See Ext.Component.getBubbleTarget) by calling enableBubble.
Available since: 1.1.0
Parameters
- eventName : String
The name of the event to fire.
- args : Object...
Variable number of parameters are passed to handlers.
Returns
- Boolean
returns false if any of the handlers return false otherwise it returns true.
Provides the link for Observable's fireEvent method to bubble up the ownership hierarchy.
Available since: 1.1.0
Returns
- Ext.Container
the Container which owns this Component.
Retrieves the top level element representing this component.
Available since: 1.1.0
Gets the current height of the component's underlying element.
Available since: 1.1.0
Returns
- Number
Retrieves the id of this component. Will autogenerate an id if one has not already been set.
Available since: 1.1.0
This function takes the position argument passed to onRender and returns a DOM element that you can use in the insertBefore.
Available since: 1.1.0
Parameters
- position : String/Number/Element/HTMLElement
Index, element id or element you want to put this component before.
Returns
- HTMLElement
DOM element that you can use in the insertBefore
Gets a template node.
Available since: 1.1.0
Parameters
- nodeInfo : HTMLElement/String/Number/Ext.data.Model
An HTMLElement template node, index of a template node, the id of a template node or the record associated with the node.
Returns
- HTMLElement
The node or null if it wasn't found
Gets a range nodes.
Available since: 1.1.0
Parameters
- start : Number (optional)
The index of the first node in the range
- end : Number (optional)
The index of the last node in the range
Returns
- Array
An array of nodes
Gets a record from a node
Available since: 1.1.0
Parameters
- node : HTMLElement
The node to evaluate
Returns
- Record
record The Ext.data.Model object
Gets an array of the records from an array of nodes
Available since: 1.1.0
Parameters
- nodes : Array
The nodes to evaluate
Returns
- Array
records The Ext.data.Model objects
Gets an array of the selected records
Available since: 1.1.0
Returns
- Array
An array of Ext.data.Model objects
Gets the number of selected nodes.
Available since: 1.1.0
Returns
- Number
The node count
Gets the current size of the component's underlying element.
Available since: 1.1.0
Returns
- Object
An object containing the element's size {width: (element width), height: (element height)}
Returns the store associated with this DataView.
Available since: 1.1.0
Returns
- Ext.data.Store
The store
This is used to determine where to insert the 'html', 'contentEl' and 'items' in this component.
Available since: 1.1.0
Gets the current width of the component's underlying element.
Available since: 1.1.0
Returns
- Number
Returns this Component's xtype hierarchy as a slash-delimited string. For a list of all available xtypes, see the Ext.Component header.
If using your own subclasses, be aware that a Component must register its own xtype to participate in determination of inherited xtypes.
Example usage:
var t = new Ext.form.Text();
alert(t.getXTypes()); // alerts 'component/field/textfield'
Available since: 1.1.0
Returns
- String
The xtype hierarchy string
Checks to see if this object has any listeners for a specified event
Available since: 1.1.0
Parameters
- eventName : String
The name of the event to check for
Returns
- Boolean
True if the event is being listened for, else false
Hide the component
Available since: 1.1.0
Parameters
- animation : Object/String/Boolean (optional)
Defaults to false.
Returns
- Ext.Component
this
Finds the index of the passed node.
Available since: 1.1.0
Parameters
- nodeInfo : HTMLElement/String/Number/Record
An HTMLElement template node, index of a template node, the id of a template node or a record associated with a node.
Returns
- Number
The index of the node or -1
Creates an array of class names from the configurations to add to this Component's el on render.
Private, but (possibly) used by ComponentQuery for selection by class name if Component is not rendered.
Available since: 1.1.0
Returns
- Array
An array of class names with which the Component's element will be rendered.
Adds ctCls to container.
Available since: 1.1.0
Parameters
- container : Object
Returns
- Ext.Element
The initialized container
Initializes this components contents. It checks for the properties html, contentEl and tpl/data.
Available since: 1.1.0
Initialized the renderData to be used when rendering the renderTpl.
Available since: 1.1.0
Returns
- Object
Object with keys and values that are going to be applied to the renderTpl
Initializes the renderTpl.
Available since: 1.1.0
Returns
- Ext.XTemplate
The renderTpl XTemplate instance.
Function description
Available since: 1.1.0
Returns
- String
A CSS style string with style, padding, margin and border.
Method to determine whether this Component is currently disabled.
Available since: 1.1.0
Returns
- Boolean
the disabled state of this Component.
Method to determine whether this Component is draggable.
Available since: 1.1.0
Returns
- Boolean
the draggable state of this component.
Method to determine whether this Component is droppable.
Available since: 1.1.0
Returns
- Boolean
the droppable state of this component.
Method to determine whether this Component is floating.
Available since: 1.1.0
Returns
- Boolean
the floating state of this component.
Method to determine whether this Component is currently set to hidden.
Available since: 1.1.0
Returns
- Boolean
the hidden state of this Component.
Returns true if the passed node is selected, else false.
Available since: 1.1.0
Parameters
- node : HTMLElement/Number/Ext.data.Model
The node, node index or record to check
Returns
- Boolean
True if selected, else false
Returns true if this component is visible.
Available since: 1.1.0
Returns
- Boolean
True if this component is visible, false otherwise.
Tests whether or not this Component is of a specific xtype. This can test whether this Component is descended from the xtype (default) or whether it is directly of the xtype specified (shallow = true).
If using your own subclasses, be aware that a Component must register its own xtype to participate in determination of inherited xtypes.
For a list of all available xtypes, see the Ext.Component header.
Example usage:
var t = new Ext.form.Text();
var isText = t.isXType('textfield'); // true
var isBoxSubclass = t.isXType('field'); // true, descended from Ext.form.Field
var isBoxInstance = t.isXType('field', true); // false, not a direct Ext.form.Field instance
Available since: 1.1.0
Parameters
- xtype : String
The xtype to check for this Component
- shallow : Boolean (optional)
False to check whether this Component is descended from the xtype (this is the default), or true to check whether this Component is directly of the specified xtype.
Returns
- Boolean
True if this component descends from the specified xtype, false otherwise.
Returns the next sibling of this Component.
Optionally selects the next sibling which matches the passed ComponentQuery selector.
May also be refered to as prev()
Available since: 1.1.0
Parameters
- selector : Object
Optional. A ComponentQuery selector to filter the following items.
Returns
- Object
The next sibling (or the next sibling which matches the selector). Returns null if there is no matching sibling.
Appends an event handler to this object (shorthand for addListener.)
Available since: 1.1.0
Parameters
- eventName : String
The type of event to listen for
- handler : Function
The method the event invokes
- scope : Object (optional)
The scope (
thisreference) in which the handler function is executed. If omitted, defaults to the object which fired the event. - options : Object (optional)
An object containing handler configuration.
Available since: 1.1.0
Parameters
- ds : Object
- records : Object
- index : Object
Method to manage awareness of when components are added to their respective Container, firing an added event. References are established at add time rather than at render time.
Available since: 1.1.0
Parameters
- container : Ext.Container
Container which holds the component
- pos : number
Position at which the component was added
Calls this.refresh if this.blockRefresh is not true
Available since: 1.1.0
Available since: 1.1.0
Parameters
- animation : Object
- fireHideEvent : Object
Available since: 1.1.0
Parameters
- record : Object
- target : Object
- index : Object
Called after the component is moved, this method is empty by default but can be implemented by any subclass that needs to perform custom logic after a move occurs.
Available since: 1.1.0
Parameters
- x : Number
The new x position
- y : Number
The new y position
Available since: 1.1.0
Parameters
- ds : Object
- record : Object
- index : Object
Method to manage awareness of when components are removed from their respective Container, firing an removed event. References are properly cleaned up after removing a component from its owning container.
Available since: 1.1.0
Available since: 1.1.0
Parameters
- scroller : Object
- pos : Object
- options : Object
Because the groups might change by an update/add/remove we refresh the whole dataview in each one of them
Available since: 1.1.0
Parameters
- store : Object
- record : Object
This complex-looking method takes a given Model instance and returns an object containing all data from all of that Model's loaded associations. It does this recursively - for example if we have a User which hasMany Orders, and each Order hasMany OrderItems, it will return an object like this:
{
orders: [
{
id: 123,
status: 'shipped',
orderItems: [
...
]
}
]
}
This makes it easy to iterate over loaded associations in a DataView.
Available since: 1.1.0
Parameters
- record : Ext.data.Model
The Model instance
- ids : Array
PRIVATE. The set of Model instance internalIds that have already been loaded
Returns
- Object
The nested data set for the Model's loaded associations
Function which can be overridden to provide custom formatting for each Record that is used by this DataView's template to render each node.
Available since: 1.1.0
Parameters
- data : Array/Object
The raw data object that was used to create the Record.
- recordIndex : Number
the index number of the Record being prepared for rendering.
- record : Record
The Record being prepared for rendering.
Returns
Returns the previous sibling of this Component.
Optionally selects the previous sibling which matches the passed ComponentQuery selector.
May also be refered to as prev()
Available since: 1.1.0
Parameters
- selector : Object
Optional. A ComponentQuery selector to filter the preceding items.
Returns
- Object
The previous sibling (or the previous sibling which matches the selector). Returns null if there is no matching sibling.
Refreshes the view by reloading the data from the store and re-rendering the template.
Available since: 1.1.0
Refreshes an individual node's data from the store.
Available since: 1.1.0
Parameters
- index : Number
The item's data index in the store
Relays selected events from the specified Observable as if the events were fired by this.
Available since: 1.1.0
Parameters
- o : Object
The Observable whose events this object is to relay.
- events : Array
Array of event names to relay.
Removes a CSS class from the top level element representing this component.
Available since: 1.1.0
Returns
- Ext.Component
Returns the Component to allow method chaining.
Removes an event handler.
Available since: 1.1.0
Parameters
- eventName : String
The type of event the handler was associated with.
- handler : Function
The handler to remove. This must be a reference to the function passed into the addListener call.
- scope : Object (optional)
The scope originally specified for the handler.
Removes listeners that were added by the mon method.
Available since: 1.1.0
Parameters
- item : Observable|Element
The item from which to remove a listener/listeners.
- ename : Object|String
The event name, or an object containing event name properties.
- fn : Function
Optional. If the
enameparameter was an event name, this is the handler function. - scope : Object
Optional. If the
enameparameter was an event name, this is the scope (thisreference) in which the handler function is executed.
Resume firing events. (see suspendEvents) If events were suspended using the queueSuspended parameter, then all events fired during event suspension will be sent to any listeners now.
Available since: 1.1.0
Selects a record instance by record instance or index.
Available since: 1.1.0
Parameters
- records : Ext.data.Record/Index
An array of records or an index
- keepExisting : Boolean
- suppressEvent : Boolean
Set to false to not fire a select event
Set the current active group
Available since: 1.1.0
Parameters
- group : Object
The group to set active
Show this component centered of its parent or the window This only applies when the component is floating.
Available since: 1.1.0
Parameters
- centered : Boolean
True to center, false to remove centering
Returns
- Ext.Component
this
Enable or disable the component.
Available since: 1.1.0
Parameters
- disabled : Boolean
Sets the dock position of this component in its parent panel. Note that this only has effect if this item is part of the dockedItems collection of a parent that has a DockLayout (note that any Panel has a DockLayout by default)
Available since: 1.1.0
Parameters
- dock : Object
- layoutParent : Object
Returns
- Component
this
Sets a Component as draggable.
Available since: 1.1.0
Parameters
- draggable : Boolean/Mixed
On first call, this can be a config object for Ext.util.Draggable. Afterwards, if set to false, the existing draggable object will be disabled
- autoShow : Boolean
Sets a Component as floating.
Available since: 1.1.0
Parameters
- floating : Boolean
- autoShow : Boolean
Sets the height of the component. This method fires the resize event.
Available since: 1.1.0
Parameters
- height : Number
The new height to set. This may be one of:
- A Number specifying the new height in the Element's Ext.Element.defaultUnits (by default, pixels).
- A String used to set the CSS height style.
- undefined to leave the height unchanged.
Returns
- Ext.Component
this
This method allows you to show or hide a LoadMask on top of this component.
Available since: 1.1.0
Parameters
- load : Boolean/Object
True to show the default LoadMask or a config object that will be passed to the LoadMask constructor. False to hide the current LoadMask.
- targetEl : Boolean
True to mask the targetEl of this Component instead of the this.el. For example, setting this to true on a Panel will cause only the body to be masked. (defaults to false)
Returns
- Ext.LoadMask
The LoadMask instance that has just been shown.
Sets the orientation for the Panel.
Available since: 1.1.0
Parameters
- orientation : String
'landscape' or 'portrait'
- width : Number/String
New width of the Panel.
- height : Number/String
New height of the Panel.
Sets the left and top of the component. To set the page XY position instead, use setPagePosition. This method fires the move event.
Available since: 1.1.0
Parameters
- left : Number
The new left
- top : Number
The new top
Returns
- Ext.Component
this
Sets a Component as scrollable.
Available since: 1.1.0
Parameters
- config : Mixed
Acceptable values are a Ext.Scroller configuration, 'horizontal', 'vertical', 'both', and false
Sets the width and height of this Component. This method fires the resize event. This method can accept
either width and height as separate arguments, or you can pass a size object like {width:10, height:20}.
Available since: 1.1.0
Parameters
- width : Mixed
The new width to set. This may be one of:
- A Number specifying the new width in the Element's Ext.Element.defaultUnits (by default, pixels).
- A String used to set the CSS width style.
- A size object in the format
{width: widthValue, height: heightValue}. undefinedto leave the width unchanged.
- height : Mixed
The new height to set (not required if a size object is passed as the first arg). This may be one of:
- A Number specifying the new height in the Element's Ext.Element.defaultUnits (by default, pixels).
- A String used to set the CSS height style. Animation may not be used.
undefinedto leave the height unchanged.
Returns
- Ext.Component
this
Convenience function to hide or show this component by boolean.
Available since: 1.1.0
Parameters
- visible : Boolean
True to show, false to hide
Returns
- Ext.Component
this
Sets the width of the component. This method fires the resize event.
Available since: 1.1.0
Parameters
- width : Number
The new width to setThis may be one of:
- A Number specifying the new width in the Element's Ext.Element.defaultUnits (by default, pixels).
- A String used to set the CSS width style.
Returns
- Ext.Component
this
Show the component.
Available since: 1.1.0
Parameters
- animation : Object/String/Boolean (optional)
Defaults to false.
Returns
- Ext.Component
this
Overrides: Ext.lib.Component.show
Show this component relative another component or element.
Available since: 1.1.0
Parameters
- alignTo : Mixed
Element or Component
- animation : Object/String/Boolean
- allowOnSide : Boolean
true to allow this element to be aligned on the left or right.
Returns
- Ext.Component
this
Suspend the firing of all events. (see resumeEvents)
Available since: 1.1.0
Parameters
- queueSuspended : Boolean
Pass as true to queue up suspended events to be fired after the resumeEvents call instead of discarding all suspended events;
Removes an event handler (shorthand for removeListener.)
Available since: 1.1.0
Parameters
- eventName : String
The type of event the handler was associated with.
- handler : Function
The handler to remove. This must be a reference to the function passed into the addListener call.
- scope : Object (optional)
The scope originally specified for the handler.
Walks up the ownerCt axis looking for an ancestor Container which matches
the passed simple selector.
Example:
var owningTabContainer = grid.up('tabcontainer');
Available since: 1.1.0
Parameters
- selector : String
Optional. The simple selector to test.
Returns
- Ext.Container
The matching ancestor Container (or
undefinedif no match was found).
Inherit docs
Update the content area of a component.
Available since: 1.1.0
Parameters
- htmlOrData : Mixed
If this component has been configured with a template via the tpl config then it will use this argument as data to populate the template. If this component was not configured with a template, the components content area will be updated via Ext.Element update
- loadScripts : Boolean
(optional) Only legitimate when using the html configuration. Defaults to false
- callback : Function
(optional) Only legitimate when using the html configuration. Callback to execute when scripts have finished loading
Overrides: Ext.lib.Component.update
Events
Fires after a Component has been visually activated.
Available since: 1.1.0
Parameters
- this : Ext.Component
Fires after a Component had been added to a Container.
Available since: 1.1.0
Parameters
- this : Ext.Component
- container : Ext.Container
Parent Container
- pos : Number
position of Component
Fires after the component rendering is finished.
The afterrender event is fired after this Component has been rendered, been postprocesed by any afterRender method defined for the Component, and, if stateful, after state has been restored.
Available since: 1.1.0
Parameters
- this : Ext.Component
Fires before a Component has been visually activated. Returning false from an event listener can prevent the activate from occurring.
Available since: 1.1.0
Parameters
- this : Ext.Component
Fires before a Component has been visually deactivated. Returning false from an event listener can prevent the deactivate from occurring.
Available since: 1.1.0
Parameters
- this : Ext.Component
Fires before the component is destroyed. Return false from an event handler to stop the destroy.
Available since: 1.1.0
Parameters
- this : Ext.Component
Fires before the component is hidden when calling the hide method. Return false from an event handler to stop the hide.
Available since: 1.1.0
Parameters
- this : Ext.Component
Fires before the orientation changes, if the monitorOrientation configuration is set to true. Return false to stop the orientation change.
Available since: 1.1.0
Parameters
- this : Ext.Panel
- orientation : String
'landscape' or 'portrait'
- width : Number
- height : Number
Fires before the view is refreshed
Available since: 1.1.0
Parameters
- this : Ext.DataView
The DataView object
Fires before the component is rendered. Return false from an event handler to stop the render.
Available since: 1.1.0
Parameters
- this : Ext.Component
Fires before a selection is made. If any handlers return false, the selection is cancelled.
Available since: 1.1.0
Parameters
- this : Ext.DataView
- node : HTMLElement
The node to be selected
- selections : Array
Array of currently selected nodes
Fires before the component is shown when calling the show method. Return false from an event handler to stop the show.
Available since: 1.1.0
Parameters
- this : Ext.Component
Fires when a tap occurs and it is not on a template node.
Available since: 1.1.0
Parameters
- this : Ext.DataView
- e : Ext.EventObject
The raw event object
Fires after a Component has been visually deactivated.
Available since: 1.1.0
Parameters
- this : Ext.Component
Fires when the user taps the disclosure icon on an item
Available since: 1.1.0
Parameters
- record : Ext.data.Record
The record associated with the item
- node : Ext.Element
The wrapping element of this node
- index : Number
The index of this list item
- e : Ext.util.Event
The tap event that caused this disclose to fire
Fires after the component is hidden. Fires after the component is hidden when calling the hide method.
Available since: 1.1.0
Parameters
- this : Ext.Component
Fires when a node is double tapped on
Available since: 1.1.0
Parameters
- this : Ext.DataView
The DataView object
- index : Number
The index of the item that was tapped
- item : Ext.Element
The item element
- e : Ext.EventObject
The event object
Fires when a node is swipped
Available since: 1.1.0
Parameters
- this : Ext.DataView
The DataView object
- index : Number
The index of the item that was tapped
- item : Ext.Element
The item element
- e : Ext.EventObject
The event object
Fires when a node is tapped on
Available since: 1.1.0
Parameters
- this : Ext.DataView
The DataView object
- index : Number
The index of the item that was tapped
- item : Ext.Element
The item element
- e : Ext.EventObject
The event object
Fires after the component is moved.
Available since: 1.1.0
Parameters
- this : Ext.Component
- x : Number
The new x position
- y : Number
The new y position
Fires when the orientation changes, if the monitorOrientation configuration is set to true.
Available since: 1.1.0
Parameters
- this : Ext.Panel
- orientation : String
'landscape' or 'portrait'
- width : Number
- height : Number
Fires when the view is refreshed
Available since: 1.1.0
Parameters
- this : Ext.DataView
The DataView object
Fires when a component is removed from an Ext.Container
Available since: 1.1.0
Parameters
- this : Ext.Component
- ownerCt : Ext.Container
Container which holds the component
Fires after the component is resized.
Available since: 1.1.0
Parameters
- this : Ext.Component
- adjWidth : Number
The box-adjusted width that was set
- adjHeight : Number
The box-adjusted height that was set
- rawWidth : Number
The width that was originally specified
- rawHeight : Number
The height that was originally specified
Fires when the selected nodes change.
Available since: 1.1.0
Parameters
- selectionModel : Ext.DataViewSelectionModel
The selection model of this DataView object
- records : Array
Array of the selected records
Fires after the component is shown when calling the show method.
Available since: 1.1.0
Parameters
- this : Ext.Component
CSS Variables
Background-color for pressed list rows.
Defaults to: $include-highlights
Available since: Touch 1.1.1
Background-color for selected list rows.
Defaults to: $active-color
Available since: Touch 1.1.1
Gradient style for selected list rows.
Defaults to: $base-gradient
Available since: Touch 1.1.1
Background-color for list rows.
Defaults to: #f7f7f7
Available since: Touch 1.1.1
Text color for list rows.
Defaults to: #000
Available since: Touch 1.1.1
Default size (width/height) for disclosure icons.
Defaults to: 1.7em
Available since: Touch 1.1.1
Background-color for list header rows (in grouped lists).
Defaults to: lighten ( saturate ( $base-color , 10% ) , 20% )
Available since: Touch 1.1.1
Gradient style for list header rows (in grouped lists). @see background-gradient
Defaults to: $base-gradient
Available since: Touch 1.1.1
Background-color for pressed list rows.
Defaults to: lighten ( $active-color , 50% )
Available since: Touch 1.1.1
CSS Mixins
Includes default list styles.
Available since: Touch 1.1.1