Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-2248 in a recent build.
  1. #1
    Sencha Premium Member
    Join Date
    Feb 2012
    Posts
    36
    Vote Rating
    2
    mangvlad is on a distinguished road

      0  

    Default Select field change event

    Select field change event


    It appears that change event for select field fires when form record gets loaded and when actual selection is done, without any way to know the difference between the two...

    (Note: text field seems to be different - no event on data load; only when text is changed by the user).

    With this current way of select field firing event on data load it is impossible to write any change handlers, since any handler code gets fired before the data even fully loaded

    Version used: ST2 RC

  2. #2
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,158
    Vote Rating
    6
    rdougan will become famous soon enough

      0  

    Default


    We thought that it made sense because the selected record is changing, but after a second thought, it doesn't really. Will fix for the next release.
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

  3. #3
    Sencha Premium Member
    Join Date
    Feb 2012
    Posts
    36
    Vote Rating
    2
    mangvlad is on a distinguished road

      0  

    Default


    Any work around I can use for now?

    I have a form that has one text field, two select fields and one spinner and for any change to any field I need to keep updating my local DB (SQLite) without any additional action from the user. (The form is loaded from a model)
    For now I am catching change event for the text field, spin for the spinner and if this is fixed I can use change event for select fields...

    Any better ways to do this? I have noticed that model has no events so it seems that there is no generic way to do this; it all has to be specific for each field/field type...

  4. #4
    Sencha User
    Join Date
    Jan 2012
    Posts
    15
    Vote Rating
    0
    quangnd412 is on a distinguished road

      0  

    Default


    You should call on() to register event after create or load data, and un() before that. I have to do so.

  5. #5
    Sencha User
    Join Date
    Aug 2011
    Posts
    36
    Vote Rating
    0
    ikim is on a distinguished road

      0  

    Default


    Is this fix in the latest Sencha Designer Version 2.0.0 Build 298? I seem to be getting the original behavior.

  6. #6
    Sencha - Sencha Touch Dev Team Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    20
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    Quote Originally Posted by ikim View Post
    Is this fix in the latest Sencha Designer Version 2.0.0 Build 298? I seem to be getting the original behavior.
    I don't believe the Designer is up to RC2 yet.

    Sencha Inc

    Jamie Avins

    @jamieavins

  7. #7
    Sencha User
    Join Date
    Apr 2012
    Posts
    103
    Vote Rating
    10
    pepperseb is on a distinguished road

      0  

    Default


    I still have this bug (2.0.1).

    And I see other users getting this bug in the change event documentation comments (http://docs.sencha.com/touch/2-0/#!/...t-event-change)

  8. #8
    Sencha User
    Join Date
    Jul 2011
    Location
    Pakistan
    Posts
    82
    Vote Rating
    2
    zonaib is on a distinguished road

      0  

    Default


    isn't fixed yet???
    i have the same issue

  9. #9
    Sencha User
    Join Date
    Apr 2012
    Posts
    103
    Vote Rating
    10
    pepperseb is on a distinguished road

      1  

    Default


    I bump this thread because nobody from the Sencha team seems to be aware of this issue.

    Here's a temporary fix provided by bpulliese


    Code:
    xtype:'selectfield',
    id: 'document-selector',
    name:'options',
    docked:'top',
    initdata: true, //declare a custom variable (boolean)
    listeners: 
    {
        initialize:function(selectbox)
        {                                           
            selectbox.setOptions(options);
            selectbox.initdata = false; //set the custom variable to false once the selectbox options have been set
        },
        change: function(selectbox,newValue,oldValue)
        {
            //check if custom variable has been set to false
            if(newValue!=null&&!selectbox.initdata)
            {
                //fire your onChange method                                     
            }
        }
    }

  10. #10
    Sencha User
    Join Date
    Apr 2012
    Location
    Minsk, Belarus
    Posts
    13
    Vote Rating
    0
    Kuzzy is on a distinguished road

      0  

    Default


    pepperseb : Thanks man! It works

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi