Sencha Architect 2

Sencha Architect 2 is a great tool for creating ExtJS and Sencha Touch applications. In this article we will show how you can easily use Bancha and Sencha Architect together. For general information about Sencha Architect, please go to the Sencha Website.

Setup Sencha Architect

Sencha Architect Integration with Bancha 2

Setting up Sencha Architect to use Bancha is simple.

Just click in the Project Inspector (top right of Sencha Architect) on the plus sign and select Resource/JS Resource. Now set the url to /bancha/js/ScriptTagInitializer.js.


Creating Bancha models

Sencha Architect: Bancha Model Creation

Follow these steps to create a new Bancha model:
  1. Create a new Model
  2. Set userClassName to the CakePHP model name (e.g. User)
  3. Add a new config 'bancha' and set it to true

Because Sencha Architect 2 does not provide any way to augment the data, we can't display the available model fields inside Sencha Architect. Of course, in the browser Bancha will automatically inject all the fields, validation rules, associations and proxy configuration.


Using CakePHP Controller Methods

Sencha Architect: Bancha Controller Method Usage

Beside the model features you are also able to directly invoke any exposed CakePHP controller method. Simply use Bancha.getStub() to retrieve the stub and call the method on it. For more information read about using controller methods.


Screencast of usage in Sencha Architect

Demo Project

We have created an example app using the above described integration with Sencha Architect 2. It handles authentification, has different user levels and uses MVC. Here are the resources:

Example App
Full Code on GitHub


Comment by JLCA |

Im following the example, im getting "Bancha: Couldn't create the model cause the metadata is not loaded yet, please use onModelReady instead." Could you please provide some advice. Bancha Pro, Extjs4.2

Reply by Andreas Kern


this error is caused because you have not yet exposed the model in CakePHP. After that you will be able to use the models.

Best regards,
Andreas (Bancha Support)

Add a comment