Guide applies to: modern
Getting Started using Exft JS Add-on Components using Cmd
This guide covers adding one of the Ext JS add-on components to your application using Cmd.
Requirements
Download the Ext JS Addons Zips
There are two zip files you need to download. First download the Ext JS SDK Zip. Secondly download the Ext JS Addons zip.
Zip Name | Path to Add-ons | Description |
---|---|---|
Ext JS SDK | [zip]/packages/ | This zip contains the Ext JS SDK and standard Addons components |
Ext Premium Addons | [zip]/packages/ | The Premium add ons include Calendar, Exporter, D3, Pivot, and Froala editor components |
Start a Trial
If you already signed up for the trial you can skip this step. This sign up form sends you an email with the download links.
Download Zips from the Support Portal
Existing customers can log into the portal’s downloads section and download both zips.
Add the Add-on Component to your Project
Step 1: Extract the zip
Open the zip and extract the resources into a folder that you can keep as a reference to Ext JS resources.
Step 2: Copy the Add-on package
In this step, you copy the add-on package to your project. And in this example we will use the Calendar add-on as the example package.
- In your project root, create a folder called
[project]/packages/local
. - Copy the add-on package
[zip]/calendar
to[project]/packages/local/calendar
.
Step 3: Declare the Package in app.json
In the project’s app.json requires
property, declare the new package dependency calendar
or whatever the package name is.
Example app.json
:
"requires": [
"font-awesome",
// Declare the add-on components package here
"calendar"
],
Specific Example of app.json
:
{
"name": "MyApp",
"namespace": "MyApp",
"version": "1.0.0.0",
"framework": "ext",
"toolkit": "modern",
"theme": "theme-material",
/**
* The list of required packages (with optional versions; default is "latest").
*
* For example,
*
* "requires": [
* "charts"
* ]
*/
"requires": [
"font-awesome",
// Declare the add-on components package here
"calendar"
],
//...
Step 4: Add the Add-on Component to a View
In this step, add the enterprise component to one of the applications views. In this example, the calendar
package will be added to the Main.js
view.
Example:
{
title: 'Home',
iconCls: 'x-fa fa-home',
layout: 'fit',
items: [{
xtype: 'calendar'
}]
}
Specific Example [cmd_project]/app/view/main/Main.js
:
/**
* This class is the main view for the application. It is specified in app.js as the
* "mainView" property. That setting causes an instance of this class to be created and
* added to the Viewport container.
*/
Ext.define('MyApp.view.main.Main', {
extend: 'Ext.tab.Panel',
xtype: 'app-main',
requires: [
'Ext.MessageBox',
'Ext.layout.Fit'
],
controller: 'main',
viewModel: 'main',
defaults: {
tab: {
iconAlign: 'top'
}
},
tabBarPosition: 'bottom',
items: [
// TODO - Replace the content of this view to suit the needs of your application.
{
title: 'Home',
iconCls: 'x-fa fa-home',
layout: 'fit',
// The following grid shares a store with the classic version's grid as well!
items: [{
xtype: 'calendar'
}]
},{
title: 'Users',
iconCls: 'x-fa fa-user',
bind: {
html: '{loremIpsum}'
}
},{
title: 'Groups',
iconCls: 'x-fa fa-users',
bind: {
html: '{loremIpsum}'
}
},{
title: 'Settings',
iconCls: 'x-fa fa-cog',
bind: {
html: '{loremIpsum}'
}
}
]
});
Step 5: Try it out
Run sencha app watch
to test out the application after the calendar has been added.
What’s Next
Now you’re ready to move to the next stage of using all the Ext JS Components.