1. #1
    Ext User
    Join Date
    Jul 2009
    Posts
    3
    Vote Rating
    0
    franklinrose is on a distinguished road

      0  

    Default ext.fly in formpanel

    ext.fly in formpanel


    Hi all,
    I'm a new newbie to this Ext js,I'm trying to get values firstname value in submit button handler,I'm getting null as output in ext.fly,can you please suggest me how to solve this problem.

    Code:
    Ext.onReady(function() {
        Ext.QuickTips.init();
        var requestAjax = function() {
            alert('Hi, ');
        }
        var genres = new Ext.data.SimpleStore({
            fields: ['id', 'genre'],
            data: [['1', 'Comedy'], ['2', 'Drama'], ['3', 'Action']]
        });
        /* var genres = new Ext.data.Store({
       reader: new Ext.data.JsonReader({
       fields: ['id', 'genre_name'],
       root: 'rows'
       }),
       proxy: new Ext.data.HttpProxy({
       url: 'ajax.jsp'
       }),
       autoLoad: true
         });  */
        var User = new Ext.FormPanel({
            //url: 'movie-form-submit.php',
            renderTo: document.body,
            frame: true,
            title: 'User Registration Form',
            width: 250,
            items: [{
                xtype: 'textfield',
                fieldLabel: 'FirstName',
                id: 'FirstName',
                name: 'firstName'
            },
            {
                xtype: 'textfield',
                fieldLabel: 'LastName',
                id: 'LastName',
                name: 'lastName'
            },
            {
                xtype: 'combo',
                name: 'genre',
                fieldLabel: 'Names',
                mode: 'local',
                store: genres,
                displayField: 'genre',
                width: 120
            }
            ],
            buttons: [{
                text: 'submit',
                handler: function() {
                    var firstName = Ext.fly(firstName).getValue();
                    //var tmpParams = this.User.form.getValues();
                    alert(firstName);
                }
            },
            {
                text: 'cancel'
            }]
        });
    });
    Last edited by evant; 5 Jul 2009 at 3:22 AM. Reason: Please put code in [code][/code] tags

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,546
    Vote Rating
    62
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Where did you read about Ext.fly?

  3. #3
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,664
    Vote Rating
    7
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default


    what do you see?
    var firstName = Ext.fly(firstName).getValue();
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  4. #4
    Ext User
    Join Date
    Jul 2009
    Posts
    3
    Vote Rating
    0
    franklinrose is on a distinguished road

      0  

    Default Ext.fly

    Ext.fly


    HI,
    I've gone through the Ext doc at this location http://www.extjs.com/deploy/dev/docs/ I tried Ext.fly and Ext.get,I'm getting null.

  5. #5
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,664
    Vote Rating
    7
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default


    again, you obvious don't read exact.

    var firstName = Ext.fly(firstName).getValue();
    with var firstName you declare a var which is NULL
    Ext.fly(firstName).getValue(); you try to get a field with name of the declared var.

    firstName != FirstName
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  6. #6
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,546
    Vote Rating
    62
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Also, you are using documentation for the wrong version!

    http://extjs.com/deploy/ext-3.0-rc3/docs/

    Now, are those methods what you need?

Thread Participants: 2