1. #1
    Sencha User
    Join Date
    Feb 2008
    Posts
    36
    Vote Rating
    0
    yozefff is on a distinguished road

      0  

    Default Sencha Touch 2 Controller control

    Sencha Touch 2 Controller control


    Hi,

    I'm tryin the new Designer to generate a Sencha Touch 2 app ...

    So I've created a controller in Designer and also added a ref. But now I want to add a "control" , but I don't know where to do it in Designer ... So want this generated (the control part):

    Code:
        config: {
            refs: {
                sliderRange: '#mysliderfield'
            }
        },
        
        control : {
        	sliderRange : {
        		change : "onSliderChange"
        	}
        }
    any help?

  2. #2
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,305
    Vote Rating
    108
    ssamayoa is just really nice ssamayoa is just really nice ssamayoa is just really nice ssamayoa is just really nice

      0  

    Default


    Thats isn't the SD's way.

    Use controller action component.

    Regards.
    UI: Sencha Architect 3.x / ExtJS 4 & 5
    Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
    Application Server: Glassfish / WildFly
    Databases: Oracle / DB2 / MySQL / Firebird

    If you like my answer please vote!

  3. #3
    Sencha User
    Join Date
    Feb 2008
    Posts
    36
    Vote Rating
    0
    yozefff is on a distinguished road

      0  

    Default


    uhm .. okey?

    So I click on the controller in SD , I try to add an Action (clicked the plus icon) , then a selectbox appears with a text "Please choose an eventname by name" , but this is empty?

  4. #4
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,305
    Vote Rating
    108
    ssamayoa is just really nice ssamayoa is just really nice ssamayoa is just really nice ssamayoa is just really nice

      1  

    Default


    Nope.

    (1) D&D a "Controller Action" from toolbox then (2) fill targetType (I'm guessing is a Ext.field.Slider because the itemId you give in "refs"), (3) name (select "change"), (4) controlQuery ("
    #mysliderfield
    "), (5) give to the function whatever name you want (by default SD will set "onSliderfieldChange") then finally (6) wrote the code:

    x1.jpg
    UI: Sencha Architect 3.x / ExtJS 4 & 5
    Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
    Application Server: Glassfish / WildFly
    Databases: Oracle / DB2 / MySQL / Firebird

    If you like my answer please vote!

  5. #5
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,359
    Vote Rating
    128
    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


    Thanks for the help ssamayoa.

    This is the correct workflow. Note that this will be drastically improving (much more intuitive) in the coming builds.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  6. #6
    Sencha User
    Join Date
    Feb 2008
    Posts
    36
    Vote Rating
    0
    yozefff is on a distinguished road

      0  

    Default


    thnx!

    worked like a charm

Thread Participants: 2

Tags for this Thread