PDA

View Full Version : Add a listener to a store - how to manage this in designer



Anthony.Hall
24 Jan 2012, 7:22 AM
In my store i have a listener. This contains custom code where i do things like select items in combo boxes. My architecture is the default architecture created by the designer 1. So it's not strictly mvc

question 1.
Obviously when i export my code the listener is removed. Is there a way i can add this code into the designer

question 2.
I'm think that i need to re-structure my application to more pure MVC like the pandora example. Will the designer play nice if i make this change.

aconran
24 Jan 2012, 4:53 PM
Anthony -

This code can go into the implementation class but not the base file. (Because it will be overwritten).

We have addressed these problems in the upcoming Designer 2.0 release and you can add all of your event listeners directly in the designer. As an example we've completely reproduced the pandora example with the same MVC structure done in the standard example.

lorezyra
24 Jan 2012, 5:45 PM
@aconran: Did I read you correctly? Did you mean to say that you have recreated the pandora example in Designer 2?

aconran
30 Jan 2012, 5:15 PM
@lorezyra, Yes.

Check out the beta: http://www.sencha.com/blog/sencha-designer-2-beta-announcement/

aconran
30 Jan 2012, 10:08 PM
In Designer 2.0, once you add a Store you can go to the Events tab in the bottom right hand side of the Designer itnerface. You can then subscribe to an event.

Once the event has been added, you can then double click on it in the inspector and it will automatically jump you in to edit the source code.

lorezyra
31 Jan 2012, 6:45 PM
@Aconran:
I've read the blog about the beta release. However, there was no mention of the pandora example nor was it included. Do you have a link to that example?

aconran
31 Jan 2012, 9:23 PM
The sample projects will be continually updated...
http://www.sencha.com/forum/showthread.php?177642-Sencha-Designer-2-Beta-Download-links