1. #1
    Sencha User
    Join Date
    May 2013
    Posts
    6
    Vote Rating
    0
    uia9020 is on a distinguished road

      0  

    Default Unanswered: How to save dynamically created text fields

    Unanswered: How to save dynamically created text fields


    What I do in my code is, when I tap the 'click' button it will create a text field dynamically. But when I reload the page dynamic text field is gone. How can i sore my dynamic field locally by using Model and Store?

    here is my code:

    View:
    Code:
    Ext.define("uia.view.Main", {
        extend: 'Ext.tab.Panel',
        xtype: 'main',
        requires: ['Ext.TitleBar'],
        
        config: {
            tabBarPosition: 'bottom',
            scrollable: 'both',
            
            items: [
               
                {
                    xtype: 'fieldset',
                    id: 'contactForm',
                    iconCls: 'user',
                    title: 'Information',
            
                    items: [
                    {
                        xtype: 'textfield',
                        name: 'Name',
                        label: 'Name',
                        id: 'name'
                    },
                    {
                        xtype: 'button',
                        text: 'Click',
                        id: 'btnClick',
                        docked: 'bottom'
                    }
                    ]
                }
                
        ]
        }
    });
    Controller:
    Code:
    Ext.define('uia.controller.Main', {
        extend: 'Ext.app.Controller',
        
        config: {
            refs: {
               form: 'main', 
               contactForm: 'main #contactForm',
               btnClick: 'main #btnClick',
               textName: 'main #name'
                },
            control: {
                btnClick: {
                    tap: "onTapClick"
                }
                
            }
        },
        onTapClick: function(button){
            console.log('button was clicked');
            var val1 = this.getTextName();
            button.up('fieldset').add({
                xtype: 'textfield',
                name: 'MyField-' + button.up('fieldset').length,
                label: val1._value
                }); 
        }
    });

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,756
    Answers
    3462
    Vote Rating
    828
    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


    What do you mean reload the page?
    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.

  3. #3
    Sencha User
    Join Date
    May 2013
    Posts
    6
    Vote Rating
    0
    uia9020 is on a distinguished road

      0  

    Default


    I mean refresh the browser.

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,756
    Answers
    3462
    Vote Rating
    828
    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


    You would have to save it somehow like localstorage so you can retrieve it when the browser refreshes. Also, why are you refreshing the page?
    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.

  5. #5
    Sencha User
    Join Date
    May 2013
    Posts
    6
    Vote Rating
    0
    uia9020 is on a distinguished road

      0  

    Default


    That's what I exactly need. I need to store it in the local storage. How can I do it?

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