ExtJS 4 Loading data into form panel from store/model or via form.load

by admin on May 14th, 2013

var contactModel = component.contactDetails;
Ext.getCmp('EditContact_Form').getForm().loadRecord( contactModel );

OR

var form = this.getWebItemForm().getForm();
var data = this.getStore('WebItemsForm').getAt(0);
form.loadRecord(data);

OR

Ext.getCmp('patient-form').getForm().load({
     url:'formdata.php',
     params:{moduleId:moduleId,action:'doAction',activity:'getActivePatient'},
     success:function(form,action) {
                var res = action.result;
                Ext.getCmp('patient_count').setText(res.data.active_patient_count);
     },
    failure:function(response) {
    }
 });

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>