Open source thumbnail generator - zero cost, instant results
Try Frameit nowTrack achievements automatically - boost your performance reviews
Try demo modeSometimes you want to override one of the methods in ExtJS that return a configuration object - let's use Ext.direct.RemotingProvider's getCallData as an example, which looks like this:
Our aim is to add an 'authentication_token' property to the returned object. You could provide the full config object again in an override, but usually you're overriding to add, remove or change one or two properties and want to leave the rest unmolested. I used to find myself writing a lot of code with this pattern:
All we're really doing here is adding 1 config item - an authenticity_token, but it takes a lot of setup code to make that happen. Check out Ext.decorate:
This lets us write the same override like this:
Much nicer, we just tell it what we want with no need for unwieldy boilerplate code. This method doesn't actually exist in Ext (though it would be good if something similar did), but you could define it yourself as above to keep such code nice and dry.
For those interested in a deeper understanding of Ext JS, you might explore the article on Ext.override - Monkey Patching Ext JS, which looks into the risks and techniques of overriding methods in the library. Additionally, the post on How Ext.apply works, and how to avoid a big headache offers valuable insights into object manipulation, which is a crucial aspect of working with Ext JS.
A few days back Praveen Ray posted about 'Traits' in Ext JS. What he described is pretty much what
One of the classes that has a lot more prominence in Ext JS 4 is the data Proxy. Proxies are respons
Ext.apply is one of those magic Ext JS methods which copies the essence of one object onto another.