1. #1
    Sencha User
    Join Date
    Apr 2011
    Posts
    1
    Vote Rating
    0
    lat3ncy is on a distinguished road

      0  

    Question Application not loading JSON data into form

    Application not loading JSON data into form


    Hi,
    My ExtJS just does not load data into the form.

    PHP Code:
    Ext.define('MyWebCP.view.user.Edit', {
        
    extend'Ext.form.Panel',
        
    alias 'widget.useredit',
        
    requires: ['Ext.form.FieldSet'],
        
    uses'Ext.data.Store',

        
    title 'Personal Details',
        
        
    margins'padding: 5px',

        
    initComponent: function() {
            
    this.items = [{
                    
    xtype'fieldset',
                    
    title'Personal Details',
                    
    collapsibletrue,
                    
    defaults: { width375 },
                    
    items: [{
                        
    fieldLabel'First Name',
                        
    name'User[first_name]',
                        
    allowBlank:false,
                        
    xtype'textfield'
                    
    }, {
                        
    fieldLabel'Last Name',
                        
    name'User[last_name]',
                        
    allowBlank:false,
                        
    xtype'textfield'
                    
    }, {
                        
    fieldLabel'Company',
                        
    name'name',
                        
    xtype'textfield'
                    
    }, {
                        
    fieldLabel'Email',
                        
    name'email',
                        
    vtype:'email',
                        
    allowBlank:false,
                        
    xtype'textfield'
                    
    }, {
                        
    fieldLabel'Telephone Number',
                        
    name'User[land_line_number]',
                        
    xtype'textfield'
                    
    }, {
                        
    fieldLabel'Cellphone Number',
                        
    name'User[cellphone]',
                        
    xtype'textfield'
                    
    }, {
                        
    fieldLabel'Fax Number',
                        
    name'User[fax]',
                        
    xtype'textfield'
                    
    }]
                }, {
                    
    xtype'fieldset',
                    
    title'Street Address',
                    
    collapsibletrue,
                    
    defaults: { width375 },
                    
    defaultType:'textfield',
                    
    items:[{
                        
    fieldLabel:'Street Address',
                        
    name'Street[address]'
                    
    }, {
                        
    fieldLabel:'Suburb',
                        
    name:'Street[suburb]'
                    
    }, {
                        
    fieldLabel:'City',
                        
    name:'Street[city]'
                    
    }, {
                        
    fieldLabel:'Postal Code',
                        
    name:'Street[code]'
                    
    }]
                }, {
                    
    xtype'fieldset',
                    
    title'P.O. Box Address',
                    
    collapsibletrue,
                    
    defaults: { width375 },
                    
    defaultType:'textfield',
                    
    items:[{
                        
    fieldLabel:'P.O. Box Number',
                        
    name'PO[address]'
                    
    }, {
                        
    fieldLabel:'Suburb',
                        
    name:'PO[suburb]'
                    
    }, {
                        
    fieldLabel:'City',
                        
    name:'PO[city]'
                    
    }, {
                        
    fieldLabel:'Postal Code',
                        
    name:'PO[code]'
                    
    }]
            }];
            
    this.buttons = [
                {
                    
    text'Save',
                    
    action'save'
                
    },
                {
                    
    text'Cancel',
                    
    scopethis,
                    
    handlerthis.close
                
    }
            ];
            
    this.store Ext.create('Ext.data.Store', {
                
    autoLoadtrue,
                
    fields: ['id''name''email'],
                
    proxy: {
                    
    type'ajax',
                    
    url'/index.php/user/userinfojson',
                    
    reader: {
                        
    type'json',
                        
    root'data',
                        
    successProperty'success'
                    
    }
                }

            });

            
    this.callParent(arguments);
        }
    }) 
    Any help would be appreciated

  2. #2
    Sencha User
    Join Date
    Apr 2010
    Posts
    78
    Vote Rating
    1
    kskrumpet is on a distinguished road

      0  

    Default


    A store stores many records, and a form edits one record. You need to get a record from the store and load it into the form like this:

    Code:
      var firstRecord = myStore.getAt(0);
      var myForm = Ext.getCmp('pageform');
      myForm.getForm().loadRecord(firstRecord);
    (Code lifted and adapted from the binding grid to form example - not tested!)

    Rich
    ExtJS Developer, amongst other things

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