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.
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.
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.
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
- 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.
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 and inheritance. This is done using the checkboxes at the top of
the page. Note that filtering out private
members also filters the API class
navigation tree.
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.
Key/Value store for files. A collection represents a flat grouping of files in an application's file system, and it allows you to do basic CRUD operations on the files contained therein. Typically you don't instantiate a collection yourself; use Ext.space.SecureFiles.get() to create one.
The file
objects used in this API are instances of Ext.space.files.File.
To create a collection:
var myCollection = Ext.space.SecureFiles.get("secrets");
To retrieve file contents:
myCollection.get("someFile.txt").then(function(contents) {
// got 'em
});
To write file contents:
myCollection.set("someFile.txt", "The new contents").then(function(file) {
// `file` is the Ext.space.files.File that was written
});
...and more. See the individual methods for full documentation.
Cache a file descriptor object in our local catalog.
obj : Object
File descriptor object (as a property bag)
File object
Bulk load an array of file descriptors loaded from the bridge into our cache.
results : Array
Results of a bridge query
Array of the Ext.space.files.File objects that got cached
Create a file by name, with optional type, path, and contents.
name : String
File name
props : Object (optional)
Hash with extra data in .type and/or .contents
Promise that resolves with the Ext.space.files.File object created
Remove a file's cached object from this collection (the actual file on disk remains untouched).
file : Ext.space.files.File
File object
Retrieve an item from the local catalog, by name or File object.
fileOrName : String
File name as a string, or Ext.space.files.File object
File descriptor object
Load a file descriptor from the filesystem, by name.
name : String
File name
Promise that resolves with the file's cached catalog object; if the file isn't found, the promise rejects.
Transform a property bag file descriptor object into a real Ext.space.files.File.
obj : Object
File descriptor object (as a property bag)
File object
Move the given file into this collection, renaming it if a name is provided.
file : Ext.space.files.File
File object
name : String (optional)
New name for the file
Promise that resolves when the file is done moving
Move the given file into this collection, renaming the file if the collection already contains a file with the same name.
file : Ext.space.files.File
File object
Promise that resolves when the file is done moving
Query the collection for files matching the given criteria. See the main Ext.space.SecureFiles.query() documentation for query definitions.
query : Object (optional)
Query object
options : Object (optional)
Query options
Promise that resolves with the Ext.space.files.File objects that match the criteria.
Delete all of the files in this collection.
Promise that resolves when the files are deleted
Compress the entire collection into an archive.
var collection = Ext.space.SecureFiles.get("somepath");
collection.compress({ archiveName: "somefiles.zip" }).then(function(file) {
// do something with the archive file
});
// or specify more options:
collection.compress({
archiveName: "somefiles.blob",
path: "myArchivePath",
type: "zip"
}).then(function(file) {
// do something with the archive file
});
args : Object< / a>
Options object
archiveName : String
Name of the archive file to create
path : String (optional)
Path into which to save the archive; defaults to ""
type : String (optional)
Compression type ("zip", "zip", "bzip2", "7zip"); if this is omitted, the system will attempt to determine the compression type from the archiveName, and if it cannot be determined, defaults to "zip".
Promise that resolves with the Ext.space.files.File object for the new archive.
Returns a count of the total number of files in the collection.
var secrets = Ext.space.SecureFiles.get('secrets');
secrets.count().then(function(count) {
// done
});
Promise that resolves with the number of files in the collection
Downloads a file from the given URL into this collection.
If you pass overwrite: true in the args parameter, the file will be overwritten if the name conflicts with a file that already exists.
var secrets = Ext.space.SecureFiles.get('secrets');
// saves the file as 'file.html' from the URL
secrets.download({ url: 'http://example.com/some/file.html' }).then(function(file) {
// do something with the file
});
// overwites file.html
secrets.download({
url: 'http://example.com/some/file.html',
overwrite: true
}).then(function(file) {
// do something with the file
});
args : Object< / a>
Download parameters
url : String
The URL of the file to be downloaded
overwrite : Boolean
true/false (default false) to determine what to do in the case of a name collision.
Promise that resolves with the File object for the file downloaded
Iterates over all the files in a collection
var secrets = Ext.space.SecureFiles.get('secrets');
secrets.forEach(function(file) {...}).then(function() {
// done
});
callback : Function
Function to call once for each file in the collection. As with Array.prototype.forEach, it receives three parameters: an Ext.space.files.File object, its index in the array being iterated, and the array of files itself. Note however that the order of elements in this array are NOT guaranteed in any way.
thisArg : Object (optional)
Value to use for this
when executing the callback.
Promise that resolves with an array of the File objects operated on, after the callback has been run across the entire collection.
Get the file contents for a name.
var files = Ext.space.SecureFiles.get('secrets');
files.get('myFile').then(function(contents){
// do something with the contents of the file.
});
name : String
File name for which to retrieve contents
Promise that resolves when the contents are available
Checks to see if the given file exists.
var secrets = Ext.space.SecureFiles.get('secrets');
secrets.has('myFile').then(function(hasKey) {
// check hasKey
});
name : String
Name of the file for which to search
Promise that resolves with a boolean indicating presence of the file
Generate a list of all the names of the files in the collection, in no particular order.
var secrets = Ext.space.SecureFiles.get('secrets');
secrets.keys().then(function(keys) {
// array of file names
});
Promise that will resolve when all of the keys have been collected.
Retrieve the contents of a file by key.
key : String
File key
file : Ext.space.files.File (optional)
File object, to pass file descriptor data through into the promise
Promise that resolves with the file's contents, plus possibly the file descriptor data
Query the collection for files matching the given criteria. See the main Ext.space.SecureFiles.query() documentation for query definitions.
query : Object< / a> (optional)
Query object
name : String (optional)
exactName.txt", "*.txt", etc...
type : String
MIME type ("text/plain", etc...)
createdBefore : Date (optional)
Date object
modifiedBefore : Date (optional)
Date object
modifiedAfter : Date (optional)
Date object
options : String< / a> (optional)
modifies how the results will be returned
fetch : String (optional)
"count" or "data" (the default), to return a simple count, or the complete results, respectively
sortField : String (optional)
name of the field on which to sort
sortDirection : String (optional)
"asc" or "desc"
Promise that resolves with the Ext.space.files.File objects that match the criteria.
Deletes the file (if present).
var secrets = Ext.space.SecureFiles.get('secrets');
secrets.remove('myFile').then(function(done) {
// done
});
name : String
Name of the file to delete
Promise that resolves when the file is deleted
Remove a file from disk.
key : String
File key
Promise that resolves when the file is removed
Write the given contents to a file.
var files = Ext.space.SecureFiles.get('secrets');
files.set('myFile', 'the contents go here').then(function(file) {
// can do something with `file` here
});
File name to which to write contents, or an object
with properties specifying the name and MIME type
of the file, e.g., {name: "foo", type: "text/plain"}
.
Note that the type will only be stored if the file
is being created; if the file already exists, any
provided type will be ignored
contents : String
Contents to write
Promise that resolves when the file is written
Launches the viewer for a file.
var secrets = Ext.space.SecureFiles.get('secrets');
secrets.view('myFile').then(function() {
// launched
});
name : String
Name of the file to view
Promise that resolves when the file viewer is launched
Launch the native viewer for a file by key.
key : String
File key
Promise that resolves when the viewer is launched
Write the contents of a file by key.
key : String
File key
contents : String
Contents to write
Promise that resolves with the File object having been written