Docs Help

Terms, Icons, and Labels

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.

Access Levels

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.

Member Types

Member Syntax

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).

lookupComponent ( item ) : Ext.Component
protected

Called when a raw config object is added to this container either during initialization of the items config, or when new items are added), or {@link #insert inserted.

This method converts the passed object into an instanced child component.

This may be overridden in subclasses when special processing needs to be applied to child creation.

Parameters

item :  Object

The config object being added.

Returns
Ext.Component

The component to be added.

Let's look at each part of the member row:

Member Flags

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.

Class Icons

- 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

Member Icons

- 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

Class Member Quick-Nav Menu

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.

Getter and Setter Methods

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.

History Bar

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.

Search and Filters

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.

API Doc Class Metadata

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:

Expanding and Collapsing Examples and Class Members

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.

Desktop -vs- Mobile View

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:

Viewing the Class Source

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.

Sencha Web Application Manager 6.0.0

Guides
API
top
Filters
Related Classes

Summary

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:

Sample Code
  var myCollection = Ext.space.SecureFiles.get("secrets");

To retrieve file contents:

Sample Code
  myCollection.get("someFile.txt").then(function(contents) {
      // got 'em
  });

To write file contents:

Sample Code
  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.

No members found using the current filters

properties

files : Object
private pri

Hash of files descriptors in this collection, by file key

Defaults to: null

name : String
private pri

Root virtual path for the files in this collection

Defaults to: null

methods

_cache ( obj ) : Ext.space.files.File
private pri

Cache a file descriptor object in our local catalog.

Parameters

obj :  Object

File descriptor object (as a property bag)

Returns

:Ext.space.files.File

File object

_cacheResults ( results ) : Array
private pri

Bulk load an array of file descriptors loaded from the bridge into our cache.

Parameters

results :  Array

Results of a bridge query

Returns

:Array

Array of the Ext.space.files.File objects that got cached

_createFile ( name , [props] ) : Ext.space.Promise
private pri

Create a file by name, with optional type, path, and contents.

Parameters

name :  String

File name

props :  Object (optional)

Hash with extra data in .type and/or .contents

Returns

:Ext.space.Promise

Promise that resolves with the Ext.space.files.File object created

_disownFile ( file )
private pri

Remove a file's cached object from this collection (the actual file on disk remains untouched).

Parameters

file :  Ext.space.files.File

File object

_getItemByName ( fileOrName ) : Ext.space.files.File
private pri

Retrieve an item from the local catalog, by name or File object.

Parameters

fileOrName :  String

File name as a string, or Ext.space.files.File object

Returns

:Ext.space.files.File

File descriptor object

_loadFile ( name ) : Ext.space.Promise
private pri

Load a file descriptor from the filesystem, by name.

Parameters

name :  String

File name

Returns

:Ext.space.Promise

Promise that resolves with the file's cached catalog object; if the file isn't found, the promise rejects.

_makeFile ( obj ) : Ext.space.files.File
private pri

Transform a property bag file descriptor object into a real Ext.space.files.File.

Parameters

obj :  Object

File descriptor object (as a property bag)

Returns

:Ext.space.files.File

File object

_ownFile ( file , [name] ) : Ext.space.Promise
private pri

Move the given file into this collection, renaming it if a name is provided.

Parameters

file :  Ext.space.files.File

File object

name :  String (optional)

New name for the file

Returns

:Ext.space.Promise

Promise that resolves when the file is done moving

_ownFileSafe ( file ) : Ext.space.Promise
private pri

Move the given file into this collection, renaming the file if the collection already contains a file with the same name.

Parameters

file :  Ext.space.files.File

File object

Returns

:Ext.space.Promise

Promise that resolves when the file is done moving

_query ( [query] , [options] ) : Ext.space.Promise
private pri

Query the collection for files matching the given criteria. See the main Ext.space.SecureFiles.query() documentation for query definitions.

Parameters

query :  Object (optional)

Query object

options :  Object (optional)

Query options

Returns

:Ext.space.Promise

Promise that resolves with the Ext.space.files.File objects that match the criteria.

clear : Ext.space.Promise

Delete all of the files in this collection.

Returns

:Ext.space.Promise

Promise that resolves when the files are deleted

compress ( args ) : Ext.space.Promise

Compress the entire collection into an archive.

Sample Code
 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
 });

Parameters

Returns

:
Ext.space.Promise

Promise that resolves with the Ext.space.files.File object for the new archive.

constructor ( name )
private pri

Parameters

name :  Object

count : Ext.space.Promise

Returns a count of the total number of files in the collection.

Sample Code
 var secrets = Ext.space.SecureFiles.get('secrets');

 secrets.count().then(function(count) {
     // done
 });

Returns

:Ext.space.Promise

Promise that resolves with the number of files in the collection

download ( args ) : Ext.space.Promise

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.

Sample Code
 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
 });

Parameters

Returns

:
Ext.space.Promise

Promise that resolves with the File object for the file downloaded

forEach ( callback , [thisArg] ) : Ext.space.Promise

Iterates over all the files in a collection

Sample Code
 var secrets = Ext.space.SecureFiles.get('secrets');

 secrets.forEach(function(file) {...}).then(function() {
     // done
 });

Parameters

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.

Returns

:Ext.space.Promise

Promise that resolves with an array of the File objects operated on, after the callback has been run across the entire collection.

get ( name ) : Ext.space.Promise

Get the file contents for a name.

Sample Code
 var files = Ext.space.SecureFiles.get('secrets');

 files.get('myFile').then(function(contents){
     // do something with the contents of the file.
 });

Parameters

name :  String

File name for which to retrieve contents

Returns

:Ext.space.Promise

Promise that resolves when the contents are available

has ( name ) : Ext.space.Promise

Checks to see if the given file exists.

Sample Code
 var secrets = Ext.space.SecureFiles.get('secrets');

 secrets.has('myFile').then(function(hasKey) {
     // check hasKey
 });

Parameters

name :  String

Name of the file for which to search

Returns

:Ext.space.Promise

Promise that resolves with a boolean indicating presence of the file

keys : Ext.space.Promise

Generate a list of all the names of the files in the collection, in no particular order.

Sample Code
 var secrets = Ext.space.SecureFiles.get('secrets');

 secrets.keys().then(function(keys) {
     // array of file names
 });

Returns

:Ext.space.Promise

Promise that will resolve when all of the keys have been collected.

loadContents ( key , [file] ) : Ext.space.Promise
private pri

Retrieve the contents of a file by key.

Parameters

key :  String

File key

file :  Ext.space.files.File (optional)

File object, to pass file descriptor data through into the promise

Returns

:Ext.space.Promise

Promise that resolves with the file's contents, plus possibly the file descriptor data

remove ( name ) : Ext.space.Promise

Deletes the file (if present).

Sample Code
 var secrets = Ext.space.SecureFiles.get('secrets');

 secrets.remove('myFile').then(function(done) {
     // done
 });

Parameters

name :  String

Name of the file to delete

Returns

:Ext.space.Promise

Promise that resolves when the file is deleted

removeFile ( key ) : Ext.space.Promise
private pri

Remove a file from disk.

Parameters

key :  String

File key

Returns

:Ext.space.Promise

Promise that resolves when the file is removed

set ( name , contents ) : Ext.space.Promise

Write the given contents to a file.

Sample Code
 var files = Ext.space.SecureFiles.get('secrets');

 files.set('myFile', 'the contents go here').then(function(file) {
     // can do something with `file` here
 });

Parameters

name :  String / Object

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

Returns

:Ext.space.Promise

Promise that resolves when the file is written

view ( name ) : Ext.space.Promise

Launches the viewer for a file.

Sample Code
 var secrets = Ext.space.SecureFiles.get('secrets');

 secrets.view('myFile').then(function() {
     // launched
 });

Parameters

name :  String

Name of the file to view

Returns

:Ext.space.Promise

Promise that resolves when the file viewer is launched

viewFile ( key ) : Ext.space.Promise
private pri

Launch the native viewer for a file by key.

Parameters

key :  String

File key

Returns

:Ext.space.Promise

Promise that resolves when the viewer is launched

writeContents ( key , contents ) : Ext.space.Promise
private pri

Write the contents of a file by key.

Parameters

key :  String

File key

contents :  String

Contents to write

Returns

:Ext.space.Promise

Promise that resolves with the File object having been written

Sencha Web Application Manager 6.0.0

Ext JS
Sencha Test
Cmd
GXT
IDE Plugins
Sencha Inspector
Architect
Touch
Web Application Manager

Sencha Test

Sencha Test

Cmd

Cmd

GXT

4.x 3.x

IDE Plugins

IDE Plugins

Sencha Inspector

Sencha Inspector

Web Application Manager

Web Application Manager