the singularity of being and nothingness
Posts tagged Sencha
Some Thoughts on ExtJS 4
May 26th
Very recently, Sencha released the newest version of ExtJS-4.0. This release was significant, in addition to other important changes, because ExtJS 4 signals a real shift in how Sencha is pushing developers to use ExtJS. Before, you could really kind of hack together ExtJS apps, regardless of how well your efforts aligned with “best practices.” The same is still true, I suppose, but ExtJS 4 is now all about MVC…and they are quite vocal about it.
By this, I mean that this rework of the framework has been explicitly designed, optimized and advertised to be used in a very particular MVC-ish way. There are even some fairly involved (but still inadequate, IMO) tutorials that describe the “preferred” way for designing a full-on MVC ExtJS 4 app, and the SDK comes with some tools baked in that will even build out the “preferred” structure for you.
So it just so happened that mere weeks after the release, I had the opportunity to develop a new app, and I decided to take the dive into ExtJS 4. Here are my thoughts on the experience, in no particular order.
Learning…and LearningFirst, the learning curve-for me at least-was initially pretty steep. It wasn’t so much the MVC aspect More >
Sencha: Creating Child Stores
Oct 11th
One of the things I <3 about Sencha is the data store. They are super-simple to create, but very powerful for creating robust, data-driven applications. The other day, I found myself creating 3 data stores that were extremely similar, simply because of the fact that the data returned was fairly complex and nested. You see, with a Sencha store, you define a “root” of your data, which is really just how the store’s Reader will treat the “rows” of data that are fed into the store. This works very well, but in my scenario, I was wanting to create a master store of data defined at the highest possible root, and then create child stores based on some of the nested objects belonging to my initial data set. So in this case, instead of making 3 remote calls to get the same, but differently-structured data, I wanted to make 1 request and use the result 2 more times for different stores.
At first, I looked to the store itself for something like a “copy” or “clone” method, but there was none. There IS an option for doing an “each” loop for every record, but that just seemed a bit overkill. But More >
Sencha: Defining Store Fields
Oct 11th
If you’ve ever created a data store with the Sencha framework, you’re familiar with defining the “fields” for the store’s data. Something like this does the trick:
var myStore = new Ext.data.JsonStore({
id: "myJsonStore",
url: "datasource.js",
fields: [
"id",
"name",
"age"
]
});
This method of defining data fields works perfectly well, but is not very extensible. After all, what if you have several stores for which you want to use the same field definitions? Yeah, you can define the same fields for each store, but wouldn’t it be better to define it once, and then customize it as needed?
Fortunately, this is super-simple to do. When you define fields “inline” while creating the data store, what you are really creating is something of an impromptu MixedCollection (a Collection class that maintains both numeric indexes and keys and exposes events, per the docs). Ah, so if it’s nothing more than a Sencha object, we can abstract it from the store itself, and reuse it to our heart’s desire!
var mydef = new Ext.util.MixedCollection();
mydef.addAll([
"id",
"name",
"age"
]);
Obviously, this looks extremely similar to what we did inline. However, the huge difference is that this new, abstracted object has some handy methods for retrieval, addition More >
Ext JS is Now Sencha
Jun 16th
This caught me a little by surprise. A few days ago, Ext JS-a pretty awesome JavaScript framework-announced that it is joining forces with jQTouch and Raphaël to form a new company named Sencha. Branding, domain-everything is changing.
Personally, I really like this move. To me, it shows that Ext JS is interested in expanding in very important directions-vector graphic JS manipulation and mobile content-by teaming up with jQTouch and Raphaël. I’ve used Raphaël in the past for some pretty cool and simple effects, but have yet to really play around much with jQTouch (although it looks pretty sweet). Anyway, I am definitely looking forward to what’s ahead for this already great framework..the future looks very bright
Interested in learning more? Check out Sencha’s official blog post about the merger.
Share this: