2 * Ext JS Library 2.2.1
\r
3 * Copyright(c) 2006-2009, Ext JS, LLC.
\r
4 * licensing@extjs.com
\r
6 * http://extjs.com/license
\r
11 App.EmployeeDetails = Ext.extend(Ext.Panel, {
\r
12 startingText: 'Please select an employee.',
\r
13 initComponent: function() {
\r
14 this.tpl = Ext.XTemplate.from('employeeDetailTpl');
\r
15 this.html = this.startingText;
\r
16 App.EmployeeDetails.superclass.initComponent.call(this);
\r
18 load: function(config) {
\r
19 var config = config || {};
\r
22 success: this.onLoad,
\r
23 failure: this.onFailure,
\r
26 this.getEl().mask('Loading...');
\r
27 Ext.Ajax.request(config);
\r
29 onLoad: function(response, opts) {
\r
30 var json = Ext.decode(response.responseText);
\r
31 this.tpl.overwrite(this.body, json);
\r
32 this.getEl().unmask();
\r
34 onFailure: function() {
\r
35 this.getEl().unmask();
\r
36 Ext.Msg.alert('Fail', 'Request failed.');
\r
39 Ext.reg('employeedetails', App.EmployeeDetails);
\r