1. #1
    Ext User
    Join Date
    Aug 2008
    Location
    Italy
    Posts
    43
    Vote Rating
    0
    dinosauro is on a distinguished road

      0  

    Default setting values to textfields

    setting values to textfields


    Hi,
    I have a form with controls like textfields etc. a data store, read a record and show data in fields, is there a way to put data to controls ?

    Code:
    var ragionesociale = new Ext.form.TextField ({
        //id: 'ragionesociale',
        fieldLabel: 'Denominazione impresa',
        anchor: '97%',
        maxLength: 150,
        selectOnFocus: true,
        //value: "prova",
        maskRe: alfanumMask
        //maskRe: /([a-zA-Z0-9\s]+)$/
    });
    
    etc. etc.
    
    var editFormPanel = new Ext.form.FormPanel ({
        labelAlign: 'top',
        bodyStyle: 'padding:5px',
        items: [{
            layout: 'column',    //column
            border: false,
            items: [{
                columnWidth: 0.5,
                layout: 'form',
                border: false,
                items: [ragionesociale, indirizzo]
            },{
                columnWidth:0.5,
                layout: 'form',
                border: false,
                items: [citta, cap]
            }]
        }],
        buttons: [{
            text: ' Salva ',
            handler: salva
        },{
            text: ' Annulla ',
            handler: annulla
        }]
    });
    
    etc. etc.
    
    impreseDataStore.on('load', function() {
          sql = impreseDataStore.reader.jsonData.sql; //debug
        row = impreseDataStore.reader.jsonData.rows;
        ragionesociale.setValue(row[0].ragionesociale);
        MORE OTHER ASSIGN
    });
    is there a way to substitute assignments field by field ?

    Is it possible to use the field names written in editFormPanel at prop. items: ?

    If isnt possible automatize, i'll write again

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    87
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    Try:
    Code:
    editFormPanel.getForm().loadRecord(someRecord);
    (this assumes that the record fields and the field names match)
    or
    Code:
    editFormPanel.getForm().setValues(someObject);
    (this assumes that the object properties and the field names match)

Thread Participants: 1

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