PDA

View Full Version : Custom classes, not components



ssamayoa
10 Feb 2012, 9:40 AM
How can I include my custom classes?

For example, for constants and utility functions I use singletons which I included in my app using "requires" at application level. I cant find in Designer the ability to define custom classes (event if I have to copy/paste from my current source files), just custom components.

So, how to address this?

Regards.

aconran
10 Feb 2012, 10:38 AM
There is currently no way to create classes that are not views, models, stores or controllers.

You can always setup your constants in your Application's launch function.

You can also include external libraries that have already been developed like so:
http://www.sencha.com/forum/showthread.php?179681-How-to-add-in-non-Sencha-library-and-deploy-it

topping
17 Dec 2012, 11:33 AM
Hmm, I'm finding this to be a challenge in the context of an Architect-based application developed with a need for nested saves of Models. The simplest solution seems to be outlined here (http://www.sencha.com/forum/showthread.php?124362-Nested-loading-nested-saving-in-new-data-package#post_627595), but creating a custom writer subclass is either not obvious to this naive user or not possible.

Any thoughts on how to best handle this? Thanks!

aconran
17 Dec 2012, 1:10 PM
You can link a JS resource for your custom writer and then use an override in your store/model to leverage this writer.

In Sencha Architect 2.1.x, it is arguably 'difficult' to achieve. In Architect 2.2, we've added a feature that allows you to link custom classes that aren't natively in Architect's toolbox much easier.

topping
20 Dec 2012, 9:11 AM
In Sencha Architect 2.1.x, it is arguably 'difficult' to achieve. In Architect 2.2, we've added a feature that allows you to link custom classes that aren't natively in Architect's toolbox much easier.

There's a lot of stuff that Architect makes a lot easier, so it's not a huge loss IMHO to have to jump through hoops now and then. Is it possible for Architect to be developed with Architect? It seems like many of these issues would be evident in such a process and would get optimized quickly.

BostonMerlin
20 Dec 2012, 10:10 AM
If I'm not mistaken, Architect is built using ExtJS. Not sure if they use architect or not but I agree with your suggestion. Dog-food the app.