Tuesday, January 17, 2012

Books I am reading

Hello!

First, I'll recommend Javascript: The good parts.

Currently, I am reading the following:

Javascript Web Applications by Alex MacCaw
Javascript Patterns by Stoyan Stefanov

The javascript patterns book is exceptional for getting an idea of the power and customization javascript offers.

Wednesday, January 4, 2012

ExtJS 4.0 MVC dynamic controllers

ExtJS4 has been designed with an inheritance class based MVC core framework along with its rich set of UI controls.  The current ExtJS 4.0.7 framework supports a concept of an Application.  This application class, from my experience, works well if there is just one defined and initialized.

An application can have many controllers, however.  Each controller can take models, stores, and views.  The controller is the meat of an application and controls the logic for the views.  It is the controller we want to dynamically add at run time.

Lets setup our ajax getJS loader. Then lets get the interface, which will contain the application definition.



The long and short of it, you need to keep a reference of the application itself.  In my case:  Ext.bang.util.app is where I'm storing it.




Now, when I want to add another "sub" application (in this case, a login window), we use the application reference to getController('login'), and then init() it to run its init method.
remotejs.getJS({ js: 'login.js', app: 'bang'}, Ext.bang.util.run);




The controller does the rest. Take a look at the bang client code to see how it all fits together.

Bang.js

Hello.  Its been a while.  I took a break from coding up until around December, and since then I've been working on a new framework called bang.js.

I will take in many concepts from portalstack for security and ui.  Take a look at my github page:

https://github.com/mikekunze/bang.js