The documentation for the ExtReact product diverges somewhat from the
documentation of other Sencha products. The sections below describe
documentation for all products except where indicated as unique to
ExtReact
.
Many classes have shortcut names used when creating (instantiating) a class with a
configuration object. The shortcut name is referred to as an alias
(or xtype
if the
class extends Ext.Component). The alias/xtype is listed next to the class name of
applicable classes for quick reference.
ExtReact component classes list the configurable name prominently at the top of the API class doc followed by the fully-qualified class name.
Framework classes or their members may be specified as private
or protected
. Else,
the class / member is public
. Public
, protected
, and private
are access
descriptors used to convey how and when the class or class member should be used.
Public classes and class members are available for use by any other class or application code and may be relied upon as a stable and persistent within major product versions. Public classes and members may safely be extended via a subclass.
Protected class members are stable public
members intended to be used by the
owning class or its subclasses. Protected members may safely be extended via a subclass.
Private classes and class members are used internally by the framework and are not intended to be used by application developers. Private classes and members may change or be omitted from the framework at any time without notice and should not be relied upon in application logic.
ExtReact component classes display
configuration options as props
ExtReact component classes do not list
properties as a dedicated member type, but rather as
read only
props
static
label next to the
method name. *See Static below.Below is an example class member that we can disect to show the syntax of a class member (the lookupComponent method as viewed from the Ext.button.Button class in this case).
Let's look at each part of the member row:
lookupComponent
in this example)( item )
in this example)Ext.Component
in this case). This may be omitted for methods that do not
return anything other than undefined
or may display as multiple possible values
separated by a forward slash /
signifying that what is returned may depend on the
results of the method call (i.e. a method may return a Component if a get method calls is
successful or false
if unsuccessful which would be displayed as
Ext.Component/Boolean
).PROTECTED
in
this example - see the Flags section below)Ext.container.Container
in this example). The source
class will be displayed as a blue link if the member originates from the current class
and gray if it is inherited from an ancestor or mixed-in class.view source
in the example)item : Object
in the example).undefined
a "Returns" section
will note the type of class or object returned and a description (Ext.Component
in the
example)Available since 3.4.0
- not pictured in
the example) just after the member descriptionDefaults to: false
)The API documentation uses a number of flags to further commnicate the class member's function and intent. The label may be represented by a text label, an abbreviation, or an icon.
All ExtReact props are bindable
unless decorated as immutable
Immutable ExtReact props may not be use as a configurable prop when instantiating a component
classInstance.method1().method2().etc();
false
is returned from
an event handler- Indicates a framework class
- A singleton framework class. *See the singleton flag for more information
- A component-type framework class (any class within the Ext JS framework that extends Ext.Component)
- Indicates that the class, member, or guide is new in the currently viewed version
- Indicates a class member of type config
Or in the case of an ExtReact component class this
indicates a member of type prop
- Indicates a class member of type property
- Indicates a class member of type
method
- Indicates a class member of type event
- Indicates a class member of type
theme variable
- Indicates a class member of type
theme mixin
- Indicates that the class, member, or guide is new in the currently viewed version
Just below the class name on an API doc page is a row of buttons corresponding to the types of members owned by the current class. Each button shows a count of members by type (this count is updated as filters are applied). Clicking the button will navigate you to that member section. Hovering over the member-type button will reveal a popup menu of all members of that type for quick navigation.
Getting and setter methods that correlate to a class config option will show up in the methods section as well as in the configs section of both the API doc and the member-type menus just beneath the config they work with. The getter and setter method documentation will be found in the config row for easy reference.
ExtReact component classes do not hoist the getter /
setter methods into the prop. All methods will be described in the
Methods
section
Your page history is kept in localstorage and displayed (using the available real estate) just below the top title bar. By default, the only search results shown are the pages matching the product / version you're currently viewing. You can expand what is displayed by clicking on the button on the right-hand side of the history bar and choosing the "All" radio option. This will show all recent pages in the history bar for all products / versions.
Within the history config menu you will also see a listing of your recent page visits. The results are filtered by the "Current Product / Version" and "All" radio options. Clicking on the button will clear the history bar as well as the history kept in local storage.
If "All" is selected in the history config menu the checkbox option for "Show product details in the history bar" will be enabled. When checked, the product/version for each historic page will show alongside the page name in the history bar. Hovering the cursor over the page names in the history bar will also show the product/version as a tooltip.
Both API docs and guides can be searched for using the search field at the top of the page.
On API doc pages there is also a filter input field that filters the member rows using the filter string. In addition to filtering by string you can filter the class members by access level, inheritance, and read only. This is done using the checkboxes at the top of the page.
The checkbox at the bottom of the API class navigation tree filters the class list to include or exclude private classes.
Clicking on an empty search field will show your last 10 searches for quick navigation.
Each API doc page (with the exception of Javascript primitives pages) has a menu view of metadata relating to that class. This metadata view will have one or more of the following:
Ext.button.Button
class has an alternate class name of Ext.Button
). Alternate class
names are commonly maintained for backward compatibility.Runnable examples (Fiddles) are expanded on a page by default. You can collapse and expand example code blocks individually using the arrow on the top-left of the code block. You can also toggle the collapse state of all examples using the toggle button on the top-right of the page. The toggle-all state will be remembered between page loads.
Class members are collapsed on a page by default. You can expand and collapse members using the arrow icon on the left of the member row or globally using the expand / collapse all toggle button top-right.
Viewing the docs on narrower screens or browsers will result in a view optimized for a smaller form factor. The primary differences between the desktop and "mobile" view are:
The class source can be viewed by clicking on the class name at the top of an API doc page. The source for class members can be viewed by clicking on the "view source" link on the right-hand side of the member row.
Series is the abstract class containing the common logic to all chart series. Series includes methods from Labels, Highlights, and Callouts mixins. This class implements the logic of animating, hiding, showing all elements and returning the color of the series to be used as a legend item.
An array of color values which is used, in order of appearance, by the series. Each series can request one or more colors from the array. Radar, Scatter or Line charts require just one color each. Candlestick and OHLC require two (1 for drops + 1 for rises). Pie charts and Stacked charts (like Bar or Pie charts) require one color for each data category they represent, so one color for each slice of a Pie chart or each segment (not bar) of a Bar chart. It overrides the colors that are provided by the current theme.
Defaults to:
null
The sprite attributes that will be applied to the highlighted items in the series. If set to 'true', the default highlight style from highlightCfg will be used. If the value of this config is an object, it will be merged with the highlightCfg. In case merging of 'highlight' and 'highlightCfg' configs in not the desired behavior, provide the 'highlightCfg' instead.
Defaults to:
false
Object with the following properties:
Defaults to:
{}
display : String
Specifies the presence and position of the labels. The possible values depend on the series type. For Line and Scatter series: 'under' | 'over' | 'rotate'. For Bar and 3D Bar series: 'insideStart' | 'insideEnd' | 'outside'. For Pie series: 'outside' | 'rotate' | 'horizontal' | 'vertical'. Area, Radar and Candlestick series don't support labels. For Area and Radar series please consider using tooltips instead. 3D Pie series currently always display labels 'outside'. For all series: 'none' hides the labels.
Default value: 'none'.
color : String
The color of the label text.
Default value: '#000' (black).
field : String/String[]
The name(s) of the field(s) to be displayed in the labels. If your chart has 3 series
that correspond to the fields 'a', 'b', and 'c' of your model, and you only want to
display labels for the series 'c', you must still provide an array [null, null, 'c']
.
Default value: null.
font : String
The font used for the labels.
Default value: '14px Helvetica'.
orientation : String
Either 'horizontal' or 'vertical'. If not set (default), the orientation is inferred from the value of the flipXY property of the series.
Default value: ''.
renderer : Function
Optional function for formatting the label into a displayable value.
The arguments to the method are:
text
, sprite
, config
, rendererData
, index
Label's renderer is passed the same arguments as renderer plus one extra 'text' argument which comes first.
The attributes that have been changed or added, or the text for the label. Example to enclose every other label in parentheses:
renderer: function (text) {
if (index % 2 == 0) {
return '(' + text + ')'
}
}
Default value: null
Extra distance value for which the labelOverflow listener is triggered.
Defaults to:
null
Sets the value of labelOverflowPadding
labelOverflowPadding : Number
The sprite template used by marker instances on the series.
If the value of the marker config is set to true
or the type
of the sprite instance is not specified, the Ext.draw.sprite.Circle
sprite will be used.
Examples:
marker: true
marker: {
radius: 8
}
marker: {
type: 'arrow',
animation: {
duration: 200,
easing: 'backOut'
}
}
Defaults to:
null
This is cyclic used if series have multiple marker sprites.
Defaults to:
null
Sets the value of markerSubStyle
markerSubStyle : Object
A function that can be provided to set custom styling properties to each rendered element.
It receives (sprite, config, rendererData, index)
as parameters.
Defaults to:
null
sprite : Object
The sprite affected by the renderer. The visual attributes are in sprite.attr
.
The data field is available in sprite.getField()
.
config : Object
The sprite configuration. It varies with the series and the type of sprite:
for instance, a Line chart sprite might have just the x
and y
properties while a Bar
chart sprite also has width
and height
. A type
might be present too. For instance to
draw each marker and each segment of a Line chart, the renderer is called with the
config.type
set to either marker
or line
.
rendererData : Object
A record with different properties depending on the type of chart.
The only guaranteed property is rendererData.store
, the store used by the series.
In some cases, a store may not exist: for instance a Gauge chart may read its value directly
from its configuration; in this case rendererData.store is null and the value is
available in rendererData.value.
index : Number
The index of the sprite. It is usually the index of the store record associated
with the sprite, in which case the record can be obtained with store.getData().items[index]
.
If the chart is not associated with a store, the index represents the index of the sprite within
the series. For instance a Gauge chart may have as many sprites as there are sectors in the
background of the gauge, plus one for the needle.
The attributes that have been changed or added. Note: it is usually possible to
add or modify the attributes directly into the config
parameter and not return anything,
but returning an object with only those attributes that have been changed may allow for
optimizations in the rendering of some series. Example to draw every other marker in red:
renderer: function (sprite, config, rendererData, index) {
if (config.type === 'marker') {
return { strokeStyle: (index % 2 === 0 ? 'red' : 'black') };
}
}
Whether markers should be displayed at the data points along the line. If true, then the marker config item will determine the markers' styling.
Defaults to:
true
The store to use for this series. If not specified, the series will use the chart's store.
Defaults to:
null
Custom style configuration for the sprite used in the series. It overrides the style that is provided by the current theme.
Defaults to:
{}
The human-readable name of the series (displayed in the legend). If the series is stacked (has multiple components in it) this should be an array, where each string corresponds to a stacked component.
Defaults to:
null
Add tooltips to the visualization's markers. The config options for the
tooltip are the same configuration used with ToolTip plus a
renderer
config option and a scope
for the renderer. For example:
tooltip: {
trackMouse: true,
width: 140,
height: 28,
renderer: function (toolTip, record, ctx) {
toolTip.setHtml(record.get('name') + ': ' + record.get('data1') + ' views');
}
}
Note that tooltips are shown for series markers and won't work if the marker is not configured.
Defaults to:
null
scope : Object
The scope to use when the renderer function is called. Defaults to the Series instance.
renderer : Function
An 'interceptor' method which can be used to modify the tooltip attributes before it is shown. The renderer function is passed the following params:
toolTip : ToolTip
The tooltip instance
record : Ext.data.Model
The record instance for the chart item (sprite) currently targeted by the tooltip.
ctx : Object
A data object with values relating to the currently targeted chart sprite
category : String
The type of sprite passed to the renderer function (will be "items", "markers", or "labels" depending on the target sprite of the tooltip)
field : String
The yField for the series
index : Number
The target sprite's index within the series' items
record : Ext.data.Model
The record instance for the chart item (sprite) currently targeted by the tooltip.
series : Ext.chart.series.Series
The series instance containing the tooltip's target sprite
sprite : Ext.draw.sprite.Sprite
The sprite (item) target of the tooltip
Colors for the series can be set directly through the 'colors' config, or indirectly with the current theme or the 'colors' config that is set onto the chart. These colors are used as "fill color". Set this config to true, if you want a darker color for the strokes. Set it to false if you want to use the same color as the fill color. Alternatively, you can set it to a number between 0 and 1 to control how much darker the strokes should be.
Note: this should be initial config and cannot be changed later on.
Defaults to:
true
Override members of this class. Overridden methods can be invoked via Ext.Base#callParent.
Ext.define('My.Cat', {
constructor: function() {
alert("I'm a cat!");
}
});
My.Cat.override({
constructor: function() {
alert("I'm going to be a cat!");
this.callParent(arguments);
alert("Meeeeoooowwww");
}
});
var kitty = new My.Cat(); // alerts "I'm going to be a cat!"
// alerts "I'm a cat!"
// alerts "Meeeeoooowwww"
Direct use of this method should be rare. Use Ext.define instead:
Ext.define('My.CatOverride', {
override: 'My.Cat',
constructor: function() {
alert("I'm going to be a cat!");
this.callParent(arguments);
alert("Meeeeoooowwww");
}
});
The above accomplishes the same result but can be managed by the Ext.Loader which can properly order the override and its target class and the build process can determine whether the override is needed based on the required state of the target class (My.Cat).
members : Object
The properties to add to this class. This should be specified as an object literal containing one or more properties.
this class
Fires when the Ext.chart.AbstractChart has been attached to this series.
chart : Ext.chart.AbstractChart
series : Ext.chart.series.Series
eOpts : Object
The options object passed to Ext.util.Observable.addListener.
Fires when the Ext.chart.AbstractChart has been detached from this series.
chart : Ext.chart.AbstractChart
series : Ext.chart.series.Series
eOpts : Object
The options object passed to Ext.util.Observable.addListener.
Fires when a click event occurs on a series item. Note: This event requires the Ext.chart.plugin.ItemEvents plugin be added to the chart.
series : Ext.chart.series.Series
item : Object
event : Event
eOpts : Object
The options object passed to Ext.util.Observable.addListener.
Fires when a double click event occurs on a series item. Note: This event requires the Ext.chart.plugin.ItemEvents plugin be added to the chart.
series : Ext.chart.series.Series
item : Object
event : Event
eOpts : Object
The options object passed to Ext.util.Observable.addListener.
Fires when a mousedown event occurs on a series item. Note: This event requires the Ext.chart.plugin.ItemEvents plugin be added to the chart.
series : Ext.chart.series.Series
item : Object
event : Event
eOpts : Object
The options object passed to Ext.util.Observable.addListener.
Fires when the mouse is moved on a series item. Note: This event requires the Ext.chart.plugin.ItemEvents plugin be added to the chart.
series : Ext.chart.series.Series
item : Object
event : Event
eOpts : Object
The options object passed to Ext.util.Observable.addListener.
Fires when the mouse exits a series item. Note: This event requires the Ext.chart.plugin.ItemEvents plugin be added to the chart.
series : Ext.chart.series.Series
item : Object
event : Event
eOpts : Object
The options object passed to Ext.util.Observable.addListener.
Fires when the mouse enters a series item. Note: This event requires the Ext.chart.plugin.ItemEvents plugin be added to the chart.
series : Ext.chart.series.Series
item : Object
event : Event
eOpts : Object
The options object passed to Ext.util.Observable.addListener.
Fires when a mouseup event occurs on a series item. Note: This event requires the Ext.chart.plugin.ItemEvents plugin be added to the chart.
series : Ext.chart.series.Series
item : Object
event : Event
eOpts : Object
The options object passed to Ext.util.Observable.addListener.
Fires when a tap event occurs on a series item. Note: This event requires the Ext.chart.plugin.ItemEvents plugin be added to the chart.
series : Ext.chart.series.Series
item : Object
event : Event
eOpts : Object
The options object passed to Ext.util.Observable.addListener.
Fires when the store of the series changes.
series : Ext.chart.series.Series
newStore : Ext.data.Store
oldStore : Ext.data.Store
eOpts : Object
The options object passed to Ext.util.Observable.addListener.