Clear Up
SharpKit Reference

View Class

A mechanism for displaying data using custom layout templates and formatting.

The View uses an Ext.XTemplate as its internal templating mechanism, and is bound to an 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 click, doubleclick, mouseover, mouseout, etc. as well as a built-in selection model. In order to use these features, an itemSelector config must be provided for the View to determine what nodes it will be working with.

The example below binds a View to a and renders it into an Ext.panel.Panel.

    Ext.define('Image', {
            extend: '',
            fields: [
            { name:'src', type:'string' },
            { name:'caption', type:'string' }
            Ext.create('', {
            model: 'Image',
            data: [
            { src:'', caption:'Drawing & Charts' },
            { src:'', caption:'Advanced Data' },
            { src:'', caption:'Overhauled Theme' },
            { src:'', caption:'Performance Tuned' }
            var imageTpl = new Ext.XTemplate(
            '<tpl for=".">',
            '<div style="margin-bottom: 10px;" class="thumb-wrap">',
            '<img src="{src}" />',
            Ext.create('Ext.view.View', {
            tpl: imageTpl,
            itemSelector: 'div.thumb-wrap',
            emptyText: 'No images available',
            renderTo: Ext.getBody()

Namespace: Ext.view



Name Description
clearHighlight() Un-highlights the currently highlighted item, if any.
highlightItem(object) Highlights a given item in the View. This is called by the mouseover handler if overItemCls and trackOver are configured, but can also be called manually by other code, for instance to handle stepping through the list via keyboard navigation.
© Copyright 2005-2011 SharpKit. All rights reserved.