Try Upgrade Adviser – Scan Your Ext JS Codebase for V8 App Upgrade

Top Support Tips

October 30, 2014 1767 Views

Get a summary of this article:

Show

ExtraParams in Ext JS 5

by Greg Barry

Ext JS 4 allowed users to append extraParams directly to a connection like so:
Ext.Ajax.extraParams = { foo: “bar” };

Due to changes in the Ext JS 5 data package, this is no longer a viable solution. You should now use the setExtraParams() and getExtraParams() methods provided by Ext.data.Connection.

For instance:
Ext.Ajax.setExtraParams({
foo: “bar”
});

For more information about these methods, please review the following resources:
Ext.data.Connection

You can see this functioning in a real world situation by viewing this Fiddle’s headers for “List” in the Network Tab.


Dynamic Fields and Grid Columns in Ext JS 4

by Seth Lemmons

Changes to the Ext JS 5 data package have made flexible data much easier to work with. However, if you’re using Ext JS 4, you can use a couple lesser-known pieces of the framework to accomplish similar elasticity.

Developers don’t always have control over what dataset fields are returned to their application from the server. If you work in an environment where data is collected from multiple sources, this may very well be a recurring challenge. The data signature may change frequently and without notice from the data owner. Users often statically set fields on the model/store config (or columns on a grid). However, you can take advantage of the metachange event along with the returned metaData key to make your data more flexible.

Note: the metachange event is only fired for JSON readers at this time.

If the server response contains the key “metaData”, configurable using the reader’s metaProperty config, a number of items will be utilized from the metaData response. The root for any passed data records can be defined here as well as the fields used for the records in the store. If the records object is passed in the metaData object, the fields will be applied to the store/model using the reader automatically.

Additional information relevant to the response may also be passed back in the response as well. For example, an array of column configs for an associated store could be passed in and dynamically applied by using the store’s metachange event.

When metaData is passed back in the response, the metachange event will be fired, so its handler can fetch any data passed back and incorporate it.
var store = Ext.create(‘Ext.data.Store’, {
// …
listeners: {
‘metachange’: function(store, meta) {
myGrid.reconfigure(store, meta.columns);
}
}
});

Ideally, you don’t want to reconfigure your grid on every load unless a reconfigure of the fields/columns is needed. That said, it’s best to only pass back the metaData in the response when there is a change in the fields or columns.

For more information about the metachange event and the metaData config, please see the following resources:

Recommended Articles

Creating a Mobile Application with Ext JS and Capacitor

Introduction Modern mobile applications demand rich user experiences, cross-platform compatibility, and rapid development cycles. In this document, you will learn how Ext JS and Capacitor…

Building Real-Time Dashboards with WebSockets and Frontend Frameworks

Real-time dashboards have become essential in industries where users need instant visibility into changing data. Whether monitoring financial transactions, logistics operations, industrial systems, application health,…

Front-End Frameworks Compared in 2026: Performance, Use Cases, and Trade-offs

Front-end framework selection in 2026 centers on three critical decisions: complete platform versus ecosystem assembly, performance at enterprise scale, and long-term maintenance costs. Ext JS…

Enhancing Component Logic: A Developer’s Guide to Ext JS Plugins

In the world of Ext JS, reusability is king. While subclassing a component is a common approach to extend functionality, it often leads to rigid…

Upgrading Ext JS 7.x to 8.0: A Practical Enterprise Guide

For teams already running Ext JS 7.x, upgrading to Ext JS 8.0 is usually a manageable modernization step rather than a full-scale rebuild. Because the…

Upgrading Ext JS 6.x to 8.0: A Practical Guide

For organizations maintaining Ext JS 6.x applications, upgrading to Ext JS 8.0 is typically a modernization exercise focused on stability, maintainability, tooling alignment, and validation…

View More