1. #1
    Sencha User
    Join Date
    Jan 2012
    Location
    Rennes - France
    Posts
    172
    Answers
    2
    Vote Rating
    1
    Thierryg is on a distinguished road

      0  

    Default Answered: get fiels's content

    Answered: get fiels's content


    Hi,

    Using a navigation view, i have added fields to a view and a (submit button) :

    Code:
    {
                        title: 'LiveSum',
                        layout: 'vbox',
                        padding: 10,
                        items:
                        [
                            // ----- Live profile's name -----
                            {
                               xtype:      'textfield',
                               id:         'liveprofilename',
                               name:       'liveprofilename',
                               label:      _strings_live_name[dmngConfig.deviceLanguageID],
                               labelAlign: 'left',
                               labelWidth: '45%',
                               value:      localStorage['liveprofileName'],
                               maxLength:  10,
                               allowBlank: false,
                               readOnly:   true
                            },
                            // ----- Autorecord -----
                            {
                               xtype:      'togglefield',
                               id:         'autorecord',
                               name:       'autorecord',
                               label:      _strings_live_autorecord[dmngConfig.deviceLanguageID],
                               labelAlign: 'left',
                               labelWidth: '45%',
                               value:      false,
                            },
                            // ----- Video input -----
                            /*{
                                xtype:        'selectfield',
                                id:           'videoinput',
                                name:         'videoinput',
                                label:        _strings_live_videoinput[dmngConfig.deviceLanguageID],
                                labelAlign:   'left',
                                labelWidth:   '45%',
                                valueField:   'id',
                                displayField: 'name',
                                store:        VideoInputStore
                            },*/
                            // ----- Studio -----
                            {
                                xtype:        'selectfield',
                                id:           'studio',
                                name:         'studio',
                                label:        _strings_live_studio[dmngConfig.deviceLanguageID],
                                labelAlign:   'left',
                                labelWidth:   '45%',
                                valueField:   'id',
                                displayField: 'name',
                                store:        StudioStore
                            },
                            // ----- Live channel -----
                            {
                               xtype:      'numberfield',
                               id:         'channel',
                               name:       'channel',
                               label:      _strings_live_channel[dmngConfig.deviceLanguageID],
                               labelAlign: 'left',
                               labelWidth: '45%',
                               value:      '12',
                               maxLength:  5,
                               allowBlank: false,
                               readOnly:   true 
                            },
                            // ----- Start live button -----
                            {
                                xtype: 'button',
                                text:  _strings_live_start[dmngConfig.deviceLanguageID],
                                handler: function()
                                {
                                    // read the parameters
                                    
                                    // send the the startLive using a JsonRPC call...
                                    
                                    // Switch to the live run view
                                    liveview.push(3);
                                }
                            }
    The button well work, but i wanna know the more efficient way to get the value of each field.

    Indeed, i want to valid the form by my own before to do something else.

    Thanks you for your reply

    Regards

  2. Hi,

    No they are not.

    So the only (best) way if to get the object using their id right as the dom function getelementbyid(). In sencha touch 2 i have used the getCmp() function

    val myfield = listview.getCmp('idfield').getvalue();

    is it correct ?

    Thanks in advance.

    Regards.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,704
    Answers
    3356
    Vote Rating
    750
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    If the fields are in a form you can use the getValues method to get all the values.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User
    Join Date
    Jan 2012
    Location
    Rennes - France
    Posts
    172
    Answers
    2
    Vote Rating
    1
    Thierryg is on a distinguished road

      0  

    Default


    Hi,

    No they are not.

    So the only (best) way if to get the object using their id right as the dom function getelementbyid(). In sencha touch 2 i have used the getCmp() function

    val myfield = listview.getCmp('idfield').getvalue();

    is it correct ?

    Thanks in advance.

    Regards.

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

      0  

    Default


    Correct. It is also the most performant way.
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

  6. #5
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,704
    Answers
    3356
    Vote Rating
    750
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Quote Originally Posted by rdougan View Post
    Correct. It is also the most performant way.
    It may be the most "performant' way but not the "best" way. Using id is a crutch and ask any veteran ST/Ext JS application developer about the id usage and they will flat out tell you they don't use it.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  7. #6
    Sencha User
    Join Date
    Jan 2012
    Location
    Rennes - France
    Posts
    172
    Answers
    2
    Vote Rating
    1
    Thierryg is on a distinguished road

      0  

    Default


    Hi,

    Okay, if this is the best way, what do you suggest to do, in order to solve my need ?

    I agree, id are native to the dom and they are interesting if we are using direct dom access.

    Sencha Touch #2, is a framework above the dom and define some objects.

    Futhermore, if make introspection on objects, i have seen that sometimes some objects can hide others.

    I have to be careful if i start to work with ids.

    Thanks i advance of your reply

    Regards

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

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    It may be the most "performant' way but not the "best" way. Using id is a crutch and ask any veteran ST/Ext JS application developer about the id usage and they will flat out tell you they don't use it.
    Sure, but again, it isn't the most performant way; and on mobile devices we are seeing this more and more, especially on Android. While ComponentQuery is amazing and very flexible, you should only use it on specific cases where you cannot use id.

    Quote Originally Posted by Thierryg View Post
    Hi,

    Okay, if this is the best way, what do you suggest to do, in order to solve my need ?

    I agree, id are native to the dom and they are interesting if we are using direct dom access.

    Sencha Touch #2, is a framework above the dom and define some objects.

    Futhermore, if make introspection on objects, i have seen that sometimes some objects can hide others.

    I have to be careful if i start to work with ids.

    Thanks i advance of your reply

    Regards
    All you have to remember is that id's are unique. You can only use them once; it's as simple as that. They are not connected to the DOM in a way that the developer has to worry.
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

Thread Participants: 2

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar