1. #1
    Sencha Premium Member
    Join Date
    Oct 2011
    Location
    Baton Rouge, LA
    Posts
    76
    Vote Rating
    7
    mlmcconnell is on a distinguished road

      0  

    Default Code Editing?

    Perhaps I missed something somewhere, but I thought this edition of Designer would allow the editing of the generated code. The code view window contains a banner that says "Code is Read Only" and there doesn't seem to be an obvious way around it. How does one go about editing the code inside Designer?

    Thank You,
    M. McConnell

  2. #2
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,487
    Vote Rating
    140
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default

    M. McConnell -

    You can edit the code but the designer enforces that you follow a structure to building your applications.

    At the top left hand side of the code viewer you will see a dropdown that allows you to switch between the ui class and the implementation class. These views are read-only. All other methods in the dropdown can be edited.

    You can add more functions to the class by adding "Basic Functions" or event bindings to the class.
    Aaron Conran
    @aconran

  3. #3
    Sencha Premium Member
    Join Date
    Oct 2011
    Location
    Baton Rouge, LA
    Posts
    76
    Vote Rating
    7
    mlmcconnell is on a distinguished road

      0  

    Default

    Thanks for your quick reply, Aaron. I'll take another look when I start to piece together an application over the next couple of days.

    I have to say, the Sencha framework (and tooling) is leaps and bounds ahead of anything else I've looked out in the wild. Most of my time is spent developing enterprise Flex applications and I'm still inclined to believe Flex is better suited for large scale applications. However, with everything you're doing to make Sencha a better suite of solutions, the line is definitely starting to blur. You guys do great work.

    Thank You,
    Mike McConnell

  4. #4
    Sencha User wemerson.januario's Avatar
    Join Date
    Nov 2008
    Location
    Brazil, Goiânia
    Posts
    559
    Vote Rating
    27
    wemerson.januario has a spectacular aura about wemerson.januario has a spectacular aura about

      0  

    Default run Basic Function

    @aconran , How to run Basic Function inside Class initComponent?


    Wemerson Januario
    Blog: http://wemersonjanuario.com.br
    Twitter: @januariocoder
    From: Goiânia, GO, Brazil
    Ext JS developer and consulting

  5. #5
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,487
    Vote Rating
    140
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default

    Quote Originally Posted by wemerson.januario View Post
    @aconran , How to run Basic Function inside Class initComponent?


    THis is currently not possible.
    Aaron Conran
    @aconran

  6. #6
    Sencha User wemerson.januario's Avatar
    Join Date
    Nov 2008
    Location
    Brazil, Goiânia
    Posts
    559
    Vote Rating
    27
    wemerson.januario has a spectacular aura about wemerson.januario has a spectacular aura about

      0  

    Default

    Any alternative? Using controller?
    Wemerson Januario
    Blog: http://wemersonjanuario.com.br
    Twitter: @januariocoder
    From: Goiânia, GO, Brazil
    Ext JS developer and consulting

  7. #7
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,487
    Vote Rating
    140
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default

    We have a ticket to be able to add user specific code inside the initComponent but this is currently not possible.

    What are you trying to achieve? You probably could use a controller and/or some other technique to get what you want. If you post the full example, please start another thread and link to it from here.
    Aaron Conran
    @aconran

  8. #8
    Sencha User
    Join Date
    Mar 2010
    Posts
    9
    Vote Rating
    0
    cantorh is on a distinguished road

      0  

    Default running code in Application's launch function

    Hello,
    How's does one run code in the launch function? I ended up creating a Basic Function in the Application class and modifying (or hacking) the Application file in .metadata to get the Basic Function called from the launch function. What's the "right" way to accomplish this?

    -thanks,
    Hugo.

  9. #9
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,487
    Vote Rating
    140
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default

    Hugo -

    After clicking on the application, goto the code view. You can then change the drop down at the top left to "launch" and then edit the code.

    We know that this user experience is not ideal and are looking at how to make it more obvious.
    Aaron Conran
    @aconran

  10. #10
    Sencha User Phil.Strong's Avatar
    Join Date
    Mar 2007
    Location
    Olney, MD
    Posts
    1,953
    Vote Rating
    65
    Phil.Strong is just really nice Phil.Strong is just really nice Phil.Strong is just really nice Phil.Strong is just really nice Phil.Strong is just really nice

      0  

    Default

    One thought @wemerson.januario was to allow you to mark a function as an init function and thus Designer would call this function from the init function for a view, model, store, controller. How does that feel?
    Phil Strong
    @philstrong