Explain ExtJS 4 event handling

Let’s start by describing DOM elements’ event handling. DOM node event handling First of all you wouldn’t want to work with DOM node directly. Instead you probably would want to utilize Ext.Element interface. For the purpose of assigning event handlers, Element.addListener and Element.on (these are equivalent) were created. So, for example, if we have html: … Read more

Extjs 4 combobox default value

I had the same problem, afaik has to do with selectlist rendering before the items are added to the store. I tried the callback method mentioned above without any luck (guess it would have to be a callback on the selectlist rather than the store). I added this line after adding items to the store … Read more

ExtJs – Filter a grid with a search field in the column header

After quite much research through the sparse documentation, and thanks to great questions and answers in SO, I came up with a simple class, that adds this functionality and and allows for configurations. It looks like this: You add this field in your grid like this: Ext.define(‘Sandbox.view.OwnersGrid’, { extend: ‘Ext.grid.Panel’, requires: [‘Sandbox.view.SearchTrigger’], alias: ‘widget.ownersGrid’, store: … Read more

to initComponent() or not to initComponent()

If you do not have a deep understanding of how ExtJS class system work, you may want to follow this: Declare all non-primitive types in initComponent(). Terminology Primitive types – strings, booleans, integers, etc. Non-Primitives – arrays & objects. Explanation If the component you extend is to be created more than once, any non-primitive configs … Read more

How to display binary data as image – extjs 4

Need to convert it in base64. JS have btoa() function for it. For example: var img = document.createElement(‘img’); img.src=”data:image/jpeg;base64,” + btoa(‘your-binary-data’); document.body.appendChild(img); But i think what your binary data in pastebin is invalid – the jpeg data must be ended on ‘ffd9’. Update: Need to write simple hex to base64 converter: function hexToBase64(str) { return … Read more