JS Days 2025 is now live – Join 5,000+ devs for the premier virtual JavaScript event. Register Now

Still on Ext JS 4.x? Learn How to Build Universal Applications using Ext JS 6.6 with Open Tooling

October 18, 2018 1376 Views
Show

As I think about all of the valuable features that have been added to Ext JS since version 4, one feature that comes to the top of the list is the ability to create universal applications.

What are universal applications?

Universal applications are web applications that can ‘adapt’ to multiple device types, for example, having a desktop and a mobile version of the app. The beauty of universal applications in Ext JS is that you can create these multiple device profiles from a single code base, which gives you the ability to share all non visual parts of the application (like the data stores and controller logic) and even parts of the view. But where universal apps really shine is when the view requirements are different, for example, where the desktop version of the application can handle a very rich grid-based interface, and the mobile/phone version of the application appropriately uses a simpler list component. These two different views usually share the same back-end data needs, so those pieces of the application can be shared.

One way you can experience an example of an Ext JS universal application is by viewing our Coworkee sample application on our home page – scroll down to the ‘See What’s Possible with Ext JS’ section and click the ‘See it in Action’ button, or simply click here.

View of our Coworkee Sample Application

View of our Coworkee Sample Application

You will be prompted to log into our ‘Coworkee’ employee directory application from here. If you select the ‘Employees’ menu item on the left, you see the rich desktop version of the application:

Coworkee Sample App: Employees Menu

Coworkee Sample App: Employees Menu

Now, if I emulate a phone with the chrome dev tools, you will see how unusable the application would be if I kept the grid view as the UI for the phone.

Coworkee Sample App: Grid View

Coworkee Sample App: Grid View

Fortunately, with the universal application functionality of Ext JS, a reload of the page allows the application to detect that it is running on a phone, and the user interface adapts to the device. In this case, the mobile view uses a ‘list’ component instead of the grid to display the appropriate view to the mobile user.

Coworkee Sample App: Page Reload Detects Mobile & UI Adapts

Coworkee Sample App: Page Reload Detects Mobile & UI Adapts

How do I take advantage of universal applications in my Ext JS 6.6 projects?

With Ext JS version 6.6 we introduced a new set of tools that we call ‘Open Tooling’. These tools allow for the use of open tools like webpack, npm, babel and node. With Open Tooling we also introduced several new application generation templates, including templates to scaffold universal applications.

Download a free 30-day trial of Ext JS with Open Tooling here: https://www.sencha.com/products/extjs/evaluate/opentooling/

Once you have downloaded the trial for Ext JS with Open Tooling, follow the getting started documentation at: https://docs.sencha.com/extjs/6.6.0/guides/getting_started/open_tooling.html

Once you have the Open Tooling installed, open a terminal window and start ExtGen in interactive mode:

ext-gen app -i

When you get to the questions highlighted below, select the following:

Follow the remaining steps to generate and run your new application and run it in a browser. You will notice that you get both a desktop and a mobile/phone version of your application.

Generated Desktop Application

Generated Desktop Application

Generated Mobile Application

Generated Mobile Application

The generated desktop application includes functionality like a hideable menu on the left, single page application (SPA) routing, and a layout that allows for a detail view. The mobile version of the application uses mobile components like a ‘list’, which is a more appropriate UI component for smaller devices like phones. The mobile version is also ready to be delivered to an app store as a hybrid application with PhoneGap or Cordova.

Open Tooling also gives you the ability to add additional menu items and views to the application by creating a ‘viewpackage’. Use the following command to create a ViewPackage called ‘Employee’

ext-gen viewpackage employee

You will now see an additional menu item called ‘Employee’ in the desktop version along with a template view that is ready for you to add your specific logic.

Additional Menu Item called ‘Employee’

Additional Menu Item called ‘Employee’

You can create as many ‘viewpackages’ as you need for your application – it is a very quick way to scaffold the initial structure of your application.

Next Steps

With our Open Tooling, you can see how easy it is to create the structure of a universal application. You are able to easily scaffold your views and begin to create your desktop and mobile application structure. Give our Open Tooling a try and see how quickly you are able to begin building your applications with Ext JS 6.6. Want to learn more about how to build universal apps? Join us for a webinar on Thursday, October 25th at 10am PDT / 1pm EDT where we will provide an in-depth tutorial. Register here: https://attendee.gotowebinar.com/register/7993376260842287361.

Recommended Articles

Guide to Estimating ROI When Switching From DIY Libraries to Full Software Development Platforms Like Ext JS

Teams started with Do It Yourself, or DIY, JavaScript tools like jQuery and Bootstrap. But those fall apart as projects scale. Scattered code, user interface…

Top Frameworks Developers Are Using for Custom Software Development in 2025

We’re seeing it more every year; teams aren’t settling for plug-and-play tools anymore. In healthcare, finance, logistics, and other data-heavy industries, there’s a clear shift.…

Meet Sencha AI Coding Companion: Your AI-Powered Assistant for Faster Ext JS Development

Building modern web applications should be exciting. But too often, developers find themselves buried in documentation, endlessly Googling framework quirks, or stuck solving the same…

Ext JS 7.9 & Rapid Ext JS V1.1 Have Arrived

The Sencha team is excited to announce the latest Ext JS version 7.9 and Rapid Ext JS 1.1 release – designed to accelerate development, enhance…

How to Migrate Legacy Apps to Modern Web Apps with Ext JS

Is your team still clinging to legacy software that’s slow, hard to maintain, or frustrating for users? You’re not alone. Many organizations continue to rely…

Top 10 JS Grid Customization Tips for a Better UI Experience

Grids are pretty much everywhere in web apps. Working with financial sheets, product details, or users? Then you’ve probably used a JavaScript grid. It makes…

View More

Trusted by Top Developers: Learn how to enhance your development journey — for free

Get the latest newsletter keeping thousands of developers in the loop.

Loved by developers at