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

[code] 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) { } }); [/code]

sencha loading icon before app startup screen

In the index.html,  add a div in the body: [html] <body> <style type="text/css"> #loading-mask { position: absolute; left: 0; top: 0; width: 100%; height: 100%; background: url(resources/img/indicator.gif) no-repeat; text-align: center; } </style> <div id="loading-mask"></div> <script type="text/javascript" src="app.js"></script> [/html]   In app.js, in the launch function, once all the app initialization is finished I remove the … Read more

Manipulating datastore data after loading

[php]var restaurantsStore = this.getStore(); var avg_rating; restaurantsStore.clearFilter(); if ( restaurantsStore !== undefined ) { restaurantsStore.load({ callback: function(records, operation, success) { var proxy = restaurantsStore.getProxy(), message = proxy.getReader().rawData.message; if( success === false ){ Ext.Msg.alert(‘Operation Failed’, message); } else{ var vendor = records[0].get(‘vendor’); Ext.getCmp(‘poweredByContainer’).setVendor( vendor ); if( vendor === ‘O’ ){ for ( var index = 0; … Read more