PDA

View Full Version : Ext Designer implementation question



ShatyUT
24 May 2010, 1:40 PM
I've finally gotten my license for Designer and built my first UI with it today and noticed that everything that comes out is an extension of the component that I selected in the designer. Is that the preferred method to build a UI? All of my hand-coded stuff doesn't do it that way because the examples are not built that way either for the most part.

I just want to make sure I'm producing good code.

jarrednicholls
24 May 2010, 1:53 PM
Generally speaking, yes, creating your own sub-classes in their own .js files is the standard way that Ext recommends building a large & complex project.

Our next big feature is what's call "Promote to Class", which will allow you to save/share custom created components in the Designer for reuse, among other things.

The examples are very basic to show the components off, but not necessarily showing a good standard for organizing your project code. Small things are fine to just configure and use, but larger projects it is recommended to create sub-classes as good practice to promote component-oriented design and reuseability/extensibility.

ShatyUT
24 May 2010, 1:56 PM
Thanks for the explanation Jarred! I wish I had known that a long time ago now that I am several months into a pretty large project. I'm sure I could've read it somewhere...oh well. There will be future projects for me to do it that way.

jarrednicholls
24 May 2010, 2:02 PM
You're welcome. Being able to wrap up your behavior, event handlers, etc. inside of a custom sub-class is invaluable for well-structured javascript code. You can fudge it with using your own objects or singletons to "scope" or "namespace" your behavior, but that quickly becomes hard to maintain.