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

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.

ReExt


top

Create a React Application

Using Create React App:

  • Visit the Create React App documentation.
  • Run the command: npx create-react-app reextcra.

Using Vite:

  • Visit the Vite documentation.
  • Run the command: npm create vite@latest reextvite -- --template react-swc.

Installing ReExt

Use npm to install ReExt:

npm install @sencha/reext

Installing the Sencha ExtJS SDK

IMPORTANT - EXTJS FRAMEWORK REQUIREMENT:

ReExt is dependent on Sencha ExtJS, and to run the framework locally you must have the framework installed in the public folder of your React project.

The Quick Start application is configured to run the Sencha ExtJS version 7.8.0 Trial from a remote server.

This is for demo purposes only and is not configured for Licensed development.

A licensed Commercial version of the framework can be acquired from the Sencha Support Portal directly or this can be done using the ReExt Designer VS Code Extension (preview version).

ReExt can be configured to use any commercially available version of the Sencha Ext JS framework (7x and above).

For more information, download the ReExt Designer VS Code Extension (preview version) or contact us at sales@sencha.com.

ReExt has been tested with the latest version of the Sencha Ext JS framework, which at the time of this publishing is Sencha ExtJS version 7.8.0.

Click here to purchase a commercial version of Sencha ExtJS.

Aquiring a Licensed Version of Ext JS

To acquire a licensed version of Ext JS:

  1. Login to the Sencha Support Portal.
  2. Click the downloads menu on the left side of the page - the Sencha Downloads page will display.
  3. Click the 'Downloads' button - the 7.8.0.zip file will be downloaded (which is the latest version of Ext JS).
  4. In the file system where the 7.8.0.zip file has been downloaded, unzip the file.
  5. A folder named ext-7.8.0 will be created
  6. Copy thje ext-7.8.0 folder to the public folder of your React application
  7. In the component in your React application, change to the following ("location": "local")
import { ReExtProvider } from '@sencha/reext';

var reactroot = ReactDOM.createRoot(document.getElementById('root'));

var ReExtData = {
  "sdkversion": "7.8.0",
  "toolkit": "classic",
  "theme": "classic",
  "rtl": false,
  "locale": "en",
  "debug": false,
  "urlbase": "./",
  "location": "local"
}
var trialkey = 'trial key from email goes here...'
reactroot.render(
  <ReExtProvider splash={true} ReExtData={ReExtData} reextkey={trialkey}>
    <App />
  </ReExtProvider>
)

ReExt Trial Key

To obtain a trial key:

  • Run your ReExt application.
  • Fill in the form on the dialog that appears.
  • A trial key will be sent via email.

React Version

ReExt has been tested with the latest version of React (18.3.1).

Usage - ReExtProvider

In main.jsx or index.js use the ReExtProvider component.

import { ReExtProvider } from '@sencha/reext';

var reactroot = ReactDOM.createRoot(document.getElementById('root'));

var ReExtData = {
  "sdkversion": "7.8.0",
  "toolkit": "classic",
  "theme": "classic",
  "rtl": false,
  "locale": "en",
  "debug": false,
  "urlbase": "./",
  "location": "remote"
}
var trialkey = 'trial key from email goes here...'
reactroot.render(
  <ReExtProvider splash={true} ReExtData={ReExtData} reextkey={trialkey}>
    <App />
  </ReExtProvider>
)

Usage - Example Code

import React, { useState, useRef } from 'react';
import ReExt from '@sencha/reext';

const App=()=>{
 const [labelcmp, setLabelCmp] = useState(null);
 const labelcmpRef = useRef();
 labelcmpRef.current = labelcmp;
 const [labeltext, setLabelText] = useState('initial text');
 const [row, setRow] = useState(null);

 return (
  <div style={{
   boxSizing:'border-box',height:'100%',
   display:'flex',flexDirection:'column'
  }}>
   <ReExt xtype='logo'/>
   <div style={{display:'flex'}}>
    <ReExt xtype='button'
     config={{text:'click me',width:100,ariaLabel:'demobutton'}}
     onTap={()=>{
      labelcmpRef.current.setHtml('set using method call');
      setLabelText('set using state');
     }}
    />
   </div>
   <ReExt xtype='grid'
    style={{height:300}}
    config={{
     title: 'grid',
     columns: [
      {text:'Name',dataIndex:'name',width:200},
      {text:'Email',dataIndex:'email',flex:1},
      {text:'Phone',dataIndex:'phone',width:200}
     ],
     data: [
      {name:'Lisa',email:'lisa@simpsons.com',phone:'555-111-1224'},
      {name:'Bart',email:'bart@simpsons.com',phone:'555-222-1234'},
      {name:'Homer',email:'homer@simpsons.com',phone:'555-333-1244'},
      {name:'Marge',email:'marge@simpsons.com',phone:'555-444-1254'}
     ]
    }}
    onSelect={(grid, selected)=>{
     var row = selected[0].data
     setRow(row)
     var rowString = JSON.stringify(row)
     labelcmpRef.current.setHtml(rowString)
     setLabelText(rowString)
    }}
   />
   <div style={{flex:1,padding:20,border:'1px solid gray'}}>
    {row !== null &&
     <>
     <ReExt xtype='label' config={{html: `name: ${row.name}`}}/>
     <ReExt xtype='label' config={{html: `email: ${row.email}`}}/>
     <ReExt xtype='label' config={{html: `phone: ${row.phone}`}}/>
     </>
    }
   </div>
   <div style={{flex:1,padding:20,border:'1px solid gray'}}>
    <ReExt xtype='label'
     config={{html:'initial text'}}
     ready={(cmp)=>{
      setLabelCmp(cmp)
     }}
    />
    <ReExt xtype='label'
     config={{html:labeltext}}
    />
   </div>
  </div>
 )
}
export default App

Run the Application

  • Create React App: Run npm start.
  • Vite: Run npx vite --open.

ReExt Component

The ReExt React component has 5 static props (only xtype is required) and any number of optional event props

Example: ReExt Button

<ReExt xtype='button'
 className='okbutton'
 style={{color:'green'}}
 references={false}
 child={false}
 config={{text:'OK'}}
 ready={(cmp)=>{console.log(cmp)}}
 onTap={(button,e,eOpts)=>{console.log(`${button.text}`)}}
/>

Here are the links to the Ext JS documentation from the example above:

More details on the ReExt props

  • xtype (required): the xtype of the component as defined in Sencha documentation.
  • className (optional): the css class to be attached to the parent div of the underlying Ext JS component (each underlying ExtJS component is wrapped with a parent div that is width:'100%' and height: '100%' - unless overwritten in the className or style config)
  • style (optional): the css style to be attached to the parent div of the ExtJS component.
  • references (optional): used if using an Ext JS reference.
  • config (optional): a JavaScript object with the configs of the component as defined in Sencha documentation.
  • ready(cmp) (optional): the event that is fired by the ReExt component when the underlying ExtJS component is created. The value of this config is a function in your React hosting component with the parameter being the created ExtJS object.
  • storeloaded(store, cmp) (optional): the event that is fired by the ReExt component when the async store associated with the component is loaded.
  • 'on' props (optional): a prop that corresponds to an event fired by the ExtJS component; follow the pattern of 'on' with the first letter of the event capitalized. (ie, the button xtype has a tap event, and the corresponding prop is onTap). The value of this prop is a function in your React hosting component.

ReExt configs and events

ReExt utilizes the Ext JS framework components by providing a value for the ReExt 'xtype' prop. This prop maps to the xtype in the ExtJS documentation. You can search for any xtype in the upper right corner of the Ext JS documentation page.

For Example <ReExt xtype="button"/> for the classic toolkit maps to this page in the Ext JS 7.8 documentation:

configs

The configs tab shows all values valid for the ReExt 'config' prop. <ReExt xtype="button" config={}/>

events

The events tab shows all events - to use, prepend 'on' and capitalize the first letter of the event name:

For example, here is the page for the ReExt 'onClick' event <ReExt xtype="button" onClick={()=>{}}/>

methods

The methods tab shows all methods that can be called with the cmp parameter of the ReExt ready event <ReExt xtype="button" ready={(cmp)=>{cmp.setText('new text')}}/>

Using ExtJS Overrides

  1. Create classicoverrides.js or modernoverrides.js in the public folder.
  2. Include all override classes in this file.
  3. Set overrides: true in the ReExtData object (will only work for location = 'local').

Example:

var ReExtData = {
    "sdkversion": "7.8.0",
    "toolkit": "classic",
    "theme": "classic",
    "rtl": false,
    "locale:" "en",
    "debug": false,
    "urlbase": "./",
    "location": "local",
    "overrides": true
}

Custom Ext JS Components

To use custom Ext JS components:

  1. Create a component using Ext JS definitions (e.g., MainList.jsx).
  2. Import and use this component in your React application.

in ./app/layout.js`

'use client';
import { ReExtProvider } from '@sencha/reext';

export default function RootLayout({ children }) {
  var ReExtData = { 
  sdkversion: '7.8.0', 
  toolkit: 'classic', 
  theme: 'classic', 
  urlbase: './', 
  location: 'local' 
  };
  return (
    <html lang="en">
      <body>
          <ReExtProvider ReExtData={ReExtData}>
            {children}
          </ReExtProvider>
      </body>
    </html>
  )
}

Custom ExtJS components can now be added as an import.

in app/personnel/page.js`

'use client'
import ReExt from '@sencha/reext';
import { useState, useEffect } from 'react';

export default function Page() {
  const [ready, setReady] = useState(false);
  useEffect(() => {
    const doAsync = async () => {
      try {
        await import('./MainList');
        setReady(true)
      } catch (e) {
        console.error('fail', e)
      }
    }
    doAsync()
  }, []);
  if (!ready) {
    return <div>Loading...</div>
  }
  else {
    return (
      <ReExt xtype='mainlist'
        style={{ flex: 2, border: '1px solid gray' }}
        onSelect={(sender, record) => 
        { 
            console.log('row selected', record[0])
        }}
      />
    )
  }
}

in ./MainList.jsx`

import './PersonnelStore'
Ext.define('ReExt.view.main.List', {
    extend: 'Ext.grid.Panel',
    xtype: 'mainlist',
    store: { type: 'personnel' },
    columns: [
        { text: 'Name', dataIndex: 'name' }
    ]
})

in ./PersonnelStore.jsx`

Ext.define('ReExt.store.Personnel', {
    extend: 'Ext.data.Store',
    alias: 'store.personnel',
    data: { items: [
{name:'Jean Luc',email:"jeanluc@enterprise.com",phone:"555-111-1111"},
{name:'Worf',email:"worf@enterprise.com",phone:"555-222-2222"},
{name:'Deanna',email:"deanna@enterprise.com",phone:"555-333-3333"},
{name:'Data',email:"data@enterprise.com",phone:"555-444-4444"}
    ]},
    proxy: {
     type: 'memory',
     reader: {
      type: 'json',
      rootProperty: 'items'
     }
    }
   })

License

Trial

ReExt