Use listConfig: { listeners: { } }
Tag: Ext JS
Ext JS View controller control property
View controllers in Ext JS can only listen to events coming from controls within the parent view.
It cannot listens to events from other sources outside of the parent view, or global events.
Use Controllers to facilitate collaboration between view controllers and different views.
Html encode list items in Ext JS combo box
Use this in the config for the combo box. Replace display with the actual name of the display field.
listConfig: {
itemTpl: '<tpl for=".">{display:htmlEncode}</tpl>'
},
Blank screen with Ext JS application
Check if there is a circular reference by doing a production build, Sencha cmd will tell if there is a circular reference.
ExtJS grid column resize final event
When user resizes a column in a grid, the columnresize event is triggered multiple times for all changed columns
To do something only after all those columns are changed, handle afterlayout event instead
How to fix Ext Js grid size changes when browser window is resized
If an Ext Js grid has changes to the column sizes and child components that causes some white space below or on the side when resizing browser window. Call doLayout or updateLayout to fix.
Error processing references Ext JS 6.2
Make sure that in views, for spacer, use at least a space and not an empty string. It’s an Ext Js 6.2 bug.
Dealing with memory leaks in Sencha Ext JS
This article is useful: http://docs.sencha.com/extjs/6.2.0/guides/core_concepts/memory_management.html
Using Ext JS proxy ajax writer
The default behaviour of Ext JS proxy ajax writer seems to be to always use POST. Whenever trying to create/update/delete a record, a JSON object will be sent to the server in the request payload through POST.
It might be possible to configure the proxy and writer to use other HTTP methods like PUT and DELETE, but I haven’t seen any documentation on this yet.
The Id field is always included. So there are 3 cases
- When the request is to create/update the record, the fields with data will be included. Example: {“Id”:1, “Name”:”Tom”}. Using the Id the server can determine whether it’s a update or create request if a record with same Id already exists.
- When deleting a record, only the Id is included in the JSON object. Example: {“Id”: 1}. The server can determine that it’s a delete request by checking the number of properties the JSON object has.
If the server is written in ASP.NET Web API, it’s important to read the request body and process it manually instead of using a parameter in the method and let the framework do the deserialization automatically, because then it will not be possible to count the number of properties the object original has, the deserialized object has all properties with default values for missing ones.
Ext JS component cannot display json data read from proxy
Not entirely sure why, but when using ajax proxies, specifying the URL is not enough, the data won’t be displayed on lists/panels.
A reader must also be defined in the proxy, otherwise the data will not be read correctly
proxy: {
type: ‘ajax’,
url: ‘data.json’,
reader:{
type:’json’,
rootProperty: ‘DATA’
}
}
Make sure that
- the source data is working, test using Fiddler/POSTMan/etc
- The model’s fields match the fields in json data, case-sensitive.
- A reader is configured in the proxy
- rootProperty is set correctly and match the json data, case-sensitive.