X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/2e847cf21b8ab9d15fa167b315ca5b2fa92638fc..6b044c28b5f26fb99c86c237ffad19741c0f7f3d:/docs/output/Ext.DataView.html?ds=inline diff --git a/docs/output/Ext.DataView.html b/docs/output/Ext.DataView.html index d3ba7e3e..a19cd956 100644 --- a/docs/output/Ext.DataView.html +++ b/docs/output/Ext.DataView.html @@ -1,4 +1,7 @@ -
Observable
  Component
    BoxComponent
      DataView

Class Ext.DataView

Package:Ext
Defined In:DataView.js
Class:DataView
Subclasses:ListView
Extends:BoxComponent
A mechanism for displaying data using custom layout templates and formatting. DataView uses an Ext.XTemplate +

Class Ext.DataView

Package:Ext
Defined In:DataView.js
Class:DataView
Subclasses:ListView
Extends:BoxComponent
A mechanism for displaying data using custom layout templates and formatting. DataView 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 click, doubleclick, @@ -160,7 +163,9 @@ child items when the browser changes its width:
var myPanel = <
     }, {
         title: 'Box 3'
     }],
-});
BoxComponent boxMaxHeight : Number
The maximum value in pixels which this BoxComponent will set its height to. +});
BoxComponent blockRefresh : Boolean
Set this to true to ignore datachanged events on the bound store. This is useful if +you wish to provide custom transi...
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)
DataView boxMaxHeight : Number
The maximum value in pixels which this BoxComponent will set its height to. Warning: This will override any size mana...

The maximum value in pixels which this BoxComponent will set its height to.

Warning: This will override any size management applied by layout managers.

BoxComponent boxMaxWidth : Number
The maximum value in pixels which this BoxComponent will set its width to. Warning: This will override any size manag...

The maximum value in pixels which this BoxComponent will set its width to.

@@ -168,7 +173,10 @@ Warning: This will override any size manag...

The maxi Warning: This will override any size mana...

The minimum value in pixels which this BoxComponent will set its height to.

Warning: This will override any size management applied by layout managers.

BoxComponent boxMinWidth : Number
The minimum value in pixels which this BoxComponent will set its width to. Warning: This will override any size manag...

The minimum value in pixels which this BoxComponent will set its width to.

-

Warning: This will override any size management applied by layout managers.

BoxComponent clearCls : String
The CSS class used to to apply to the special clearing div rendered +

Warning: This will override any size management applied by layout managers.

BoxComponent bubbleEvents : Array
An array of events that, when fired, should be bubbled to any parent container. +See Ext.util.Observable.enableBubble....

An array of events that, when fired, should be bubbled to any parent container. +See Ext.util.Observable.enableBubble. +Defaults to [].

Component clearCls : String
The CSS class used to to apply to the special clearing div rendered directly after each form field wrapper to provide...

The CSS class used to to apply to the special clearing div rendered directly after each form field wrapper to provide field clearing (defaults to 'x-form-clear-left').

@@ -689,7 +697,12 @@ Or a shorthand syntax:
: void
Apply this component to existing markup that is valid. With this function, no call to render() is required.
Apply this component to existing markup that is valid. With this function, no call to render() is required.
Parameters:
  • el : String/HTMLElement
Returns:
  • void
Component bindStoreStore store ) : - void
Changes the data store bound to this view and refreshes it.
Changes the data store bound to this view and refreshes it.
Parameters:
  • store : Store
    The store to bind to this view
Returns:
  • void
DataView clearSelections[Boolean suppressEvent] ) + void
Changes the data store bound to this view and refreshes it.
Changes the data store bound to this view and refreshes it.
Parameters:
  • store : Store
    The store to bind to this view
Returns:
  • void
DataView bubbleFunction fn[Object scope][Array args] ) + : + Ext.Component
Bubbles up the component/container heirarchy, calling the specified function with each component. The scope (this) of...
Bubbles up the component/container heirarchy, calling the specified function with each component. The scope (this) of +function call will be the scope provided or the current component. The arguments to the function +will be the args provided or the current component. If the function returns false at any point, +the bubble is stopped.
Parameters:
  • fn : Function
    The function to call
  • scope : Object
    (optional) The scope of the function (defaults to current node)
  • args : Array
    (optional) The args to call the function with (default to passing the current component)
Returns:
  • Ext.Component
    this
Component clearSelections[Boolean suppressEvent] ) : void
Clears all selections.
Clears all selections.
Parameters:
  • suppressEvent : Boolean
    (optional) True to skip firing of the selectionchange event
Returns:
  • void
DataView cloneConfigObject overrides ) : @@ -703,9 +716,9 @@ DataView's 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.

Parameters:
  • records : Array
    An Array of Ext.data.Records 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 <i>named</i> properties.
DataView deselectHTMLElement/Number node ) +contain <i>named</i> properties.
DataView deselectHTMLElement/Number/Record node ) : - void
Deselects a node.
Deselects a node.
Parameters:
  • node : HTMLElement/Number
    The node to deselect
Returns:
  • void
DataView destroy() + void
Deselects a node.
Deselects a node.
Parameters:
  • node : HTMLElement/Number/Record
    The node, node index or record to deselect
Returns:
  • void
DataView destroy() : void
Destroys this component by purging any event listeners, removing the component's element from the DOM, removing the c...
Destroys this component by purging any event listeners, removing the component's element from the DOM, @@ -717,47 +730,49 @@ should usually not need to be called directly.
Enable this component and fire the 'enable' event.
Enable this component and fire the 'enable' event.
Parameters:
  • None.
Returns:
  • Ext.Component
    this
Component enableBubbleString/Array events ) : - void
Enables events fired by this Observable to bubble up an owner hierarchy by calling -this.getBubbleTarget() if present...

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.form.Field.prototype.initComponent.createSequence(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');
-        }
-    }
+                                        void
Enables events fired by this Observable to bubble up an owner hierarchy by calling +this.getBubbleTarget() if present....

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.form.Field.prototype.initComponent.createSequence(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');
+        }
+    }
 });
Parameters:
  • events : String/Array
    The event name to bubble, or an Array of event names.
Returns:
  • void
Observable findItemFromChildHTMLElement node ) : HTMLElement
Returns the template node the passed child belongs to, or null if it doesn't belong to one.
Returns the template node the passed child belongs to, or null if it doesn't belong to one.
Parameters:
  • node : HTMLElement
Returns:
  • HTMLElement
    The template node
DataView findParentByFunction fn ) : Ext.Container
Find a container above this component at any level by a custom function. If the passed function returns true, the con...
Find a container above this component at any level by a custom function. If the passed function returns -true, the container will be returned.
Parameters:
  • fn : Function
    The custom function to call with the arguments (container, this component).
Returns:
  • Ext.Container
    The first Container for which the custom function returns true
Component findParentByTypeString/Class xtype ) +true, the container will be returned.
Parameters:
  • fn : Function
    The custom function to call with the arguments (container, this component).
Returns:
  • Ext.Container
    The first Container for which the custom function returns true
Component findParentByTypeString/Ext.Component/Class xtype[Boolean shallow] ) : - Ext.Container
Find a container above this component at any level by xtype or class
Find a container above this component at any level by xtype or class
Parameters:
  • xtype : String/Class
    The xtype string for a component, or the class of the component directly
Returns:
  • Ext.Container
    The first Container which matches the given xtype or class
Component fireEventString eventNameObject... args ) + Ext.Container
Find a container above this component at any level by xtype or class
Find a container above this component at any level by xtype or class
Parameters:
  • xtype : String/Ext.Component/Class
    The xtype to check for this Component. Note that the the component can either be an instance +or a component class:
  • 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:
  • Ext.Container
    The first Container which matches the given xtype or class
Component fireEventString eventNameObject... args ) : Boolean
Fires the specified event with the passed parameters (minus the event name). An event may be set to bubble up an Obse...

Fires the specified event with the passed parameters (minus the event name).

@@ -798,9 +813,10 @@ returns an id if an id is not defined yet:
<
 itemId was not assigned through configuration the
 id is returned using g...
Returns the itemId of this component. If an itemId was not assigned through configuration the -id is returned using getId.
Parameters:
  • None.
Returns:
  • String
Component getNodeHTMLElement/String/Number nodeInfo ) +id is returned using getId.
Parameters:
  • None.
Returns:
  • String
Component getNodeHTMLElement/String/Number/Ext.data.Record nodeInfo ) : - HTMLElement
Gets a template node.
Gets a template node.
Parameters:
  • nodeInfo : HTMLElement/String/Number
    An HTMLElement template node, index of a template node or the id of a template node
Returns:
  • HTMLElement
    The node or null if it wasn't found
DataView getNodes[Number start][Number end] ) + HTMLElement
Gets a template node.
Gets a template node.
Parameters:
  • nodeInfo : HTMLElement/String/Number/Ext.data.Record
    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
DataView getNodes[Number start][Number end] ) : Array
Gets a range nodes.
Gets a range nodes.
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
DataView getOuterSize() : @@ -857,13 +873,14 @@ alert(t.getXTypes()); // alerts 'component/box/field/textfield' false to cancel hiding the component. Fires the 'h...
Hide this component. Listen to the 'beforehide' event and return false to cancel hiding the component. Fires the 'hide' event after hiding the component. Note this method is called internally if -the component is configured to be hidden.
Parameters:
  • None.
Returns:
  • Ext.Component
    this
Component indexOfHTMLElement/String/Number nodeInfo ) +the component is configured to be hidden.
Parameters:
  • None.
Returns:
  • Ext.Component
    this
Component indexOfHTMLElement/String/Number/Record nodeInfo ) : - Number
Finds the index of the passed node.
Finds the index of the passed node.
Parameters:
  • nodeInfo : HTMLElement/String/Number
    An HTMLElement template node, index of a template node or the id of a template node
Returns:
  • Number
    The index of the node or -1
DataView isSelectedHTMLElement/Number node ) + Number
Finds the index of the passed node.
Finds the index of the passed node.
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
DataView isSelectedHTMLElement/Number/Ext.data.Record node ) : - Boolean
Returns true if the passed node is selected, else false.
Returns true if the passed node is selected, else false.
Parameters:
  • node : HTMLElement/Number
    The node or node index to check
Returns:
  • Boolean
    True if selected, else false
DataView isVisible() + Boolean
Returns true if the passed node is selected, else false.
Returns true if the passed node is selected, else false.
Parameters:
  • node : HTMLElement/Number/Ext.data.Record
    The node, node index or record to check
Returns:
  • Boolean
    True if selected, else false
DataView isVisible() : - Boolean
Returns true if this component is visible.
Returns true if this component is visible.
Parameters:
  • None.
Returns:
  • Boolean
    True if this component is visible, false otherwise.
Component isXTypeString xtype[Boolean shallow] ) + Boolean
Returns true if this component is visible.
Returns true if this component is visible.
Parameters:
  • None.
Returns:
  • Boolean
    True if this component is visible, false otherwise.
Component isXTypeString/Ext.Component/Class xtype[Boolean shallow] ) : Boolean
Tests whether or not this Component is of a specific xtype. This can test whether this Component is descended from th...

Tests whether or not this Component is of a specific xtype. This can test whether this Component is descended @@ -875,7 +892,11 @@ to participate in determination of inherited xtypes.

var t = new Ext.form.TextField();
 var isText = t.isXType('textfield');        // true
 var isBoxSubclass = t.isXType('box');       // true, descended from BoxComponent
-var isBoxInstance = t.isXType('box', true); // false, not a direct BoxComponent instance
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 +var isBoxInstance = t.isXType('box', true); // false, not a direct BoxComponent instance
    Parameters:
    • xtype : String/Ext.Component/Class
      The xtype to check for this Component. Note that the the component can either be an instance +or a component class: +
      var c = new Ext.Component();
      +console.log(c.isXType(c));
      +console.log(c.isXType(Ext.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.
Component monObservable|Element itemObject|String enameFunction fnObject scopeObject opt ) : void
Adds listeners to any Observable object (or Elements) which are automatically removed when this Component @@ -949,19 +970,19 @@ which this component will be inserted (defaults to appending to the end of the c If events were suspended using the queueSuspended parameter, then all event...
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.
Parameters:
  • None.
Returns:
  • void
Observable selectArray/HTMLElement/String/Number nodeInfo[Boolean keepExisting][Boolean suppressEvent] ) +events fired during event suspension will be sent to any listeners now.
Parameters:
  • None.
Returns:
  • void
Observable selectArray/HTMLElement/String/Number/Ext.data.Record nodeInfo[Boolean keepExisting][Boolean suppressEvent] ) : - void
Selects a set of nodes.
Selects a set of nodes.
Parameters:
  • nodeInfo : Array/HTMLElement/String/Number
    An HTMLElement template node, index of a template node, -id of a template node or an array of any of those to select
  • keepExisting : Boolean
    (optional) true to keep existing selections
  • suppressEvent : Boolean
    (optional) true to skip firing of the selectionchange vent
Returns:
  • void
DataView selectRangeNumber startNumber end[Boolean keepExisting] ) + void
Selects a set of nodes.
Selects a set of nodes.
Parameters:
  • nodeInfo : Array/HTMLElement/String/Number/Ext.data.Record
    An HTMLElement template node, index of a template node, +id of a template node, record associated with a node or an array of any of those to select
  • keepExisting : Boolean
    (optional) true to keep existing selections
  • suppressEvent : Boolean
    (optional) true to skip firing of the selectionchange vent
Returns:
  • void
DataView selectRangeNumber startNumber end[Boolean keepExisting] ) : void
Selects a range of nodes. All nodes between start and end are selected.
Selects a range of nodes. All nodes between start and end are selected.
Parameters:
  • start : Number
    The index of the first node in the range
  • end : Number
    The index of the last node in the range
  • keepExisting : Boolean
    (optional) True to retain existing selections
Returns:
  • void
DataView setAutoScrollBoolean scroll ) : Ext.BoxComponent
Sets the overflow on the content element of the component.
Sets the overflow on the content element of the component.
Parameters:
  • scroll : Boolean
    True to allow the Component to auto scroll.
Returns:
  • Ext.BoxComponent
    this
BoxComponent setDisabledBoolean disabled ) : - Ext.Component
Convenience function for setting disabled/enabled by boolean.
Convenience function for setting disabled/enabled by boolean.
Parameters:
  • disabled : Boolean
Returns:
  • Ext.Component
    this
Component setHeightNumber height ) + Ext.Component
Convenience function for setting disabled/enabled by boolean.
Convenience function for setting disabled/enabled by boolean.
Parameters:
  • disabled : Boolean
Returns:
  • Ext.Component
    this
Component setHeightMixed height ) : - Ext.BoxComponent
Sets the height of the component. This method fires the resize event.
Sets the height of the component. This method fires the resize event.
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).
    • + Ext.BoxComponent
      Sets the height of the component. This method fires the resize event.
      Sets the height of the component. This method fires the resize event.
      Parameters:
      • height : Mixed
        The new height to set. This may be one of:
          +
        • A Number specifying the new height in the Element's defaultUnits (by default, pixels).
        • A String used to set the CSS height style.
        • undefined to leave the height unchanged.
      Returns:
      • Ext.BoxComponent
        this
      BoxComponent setPagePositionNumber xNumber y ) @@ -990,10 +1011,10 @@ This may be one of:
        : void
        Changes the data store bound to this view and refreshes it. (deprecated in favor of bindStore)
        Changes the data store bound to this view and refreshes it. (deprecated in favor of bindStore)
        Parameters:
        • store : Store
          The store to bind to this view
        Returns:
        • void
        DataView setVisibleBoolean visible ) : - Ext.Component
        Convenience function to hide or show this component by boolean.
        Convenience function to hide or show this component by boolean.
        Parameters:
        • visible : Boolean
          True to show, false to hide
        Returns:
        • Ext.Component
          this
        Component setWidthNumber width ) + Ext.Component
        Convenience function to hide or show this component by boolean.
        Convenience function to hide or show this component by boolean.
        Parameters:
        • visible : Boolean
          True to show, false to hide
        Returns:
        • Ext.Component
          this
        Component setWidthMixed width ) : - Ext.BoxComponent
        Sets the width of the component. This method fires the resize event.
        Sets the width of the component. This method fires the resize event.
        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).
          • + Ext.BoxComponent
            Sets the width of the component. This method fires the resize event.
            Sets the width of the component. This method fires the resize event.
            Parameters:
            • width : Mixed
              The new width to set. This may be one of:
                +
              • A Number specifying the new width in the Element's defaultUnits (by default, pixels).
              • A String used to set the CSS width style.
            Returns:
            • Ext.BoxComponent
              this
            BoxComponent show() :