Ext JS JavaScript DHTML



Hello World Window





Ext.onReady(function(){
  var userData = [
    {ID:1,FIRSTNAME:'A',LASTNAME:'B',EMAIL:'a@b.com',PASSWORD:'a',ADDRESSTYPE:'Home',STREET1:'Road',STREET2:'',STREET3:'',CITY:'New York',STATE:'NY',ZIP:'12345',PHONETYPE:'Cell',PHONE:'123-456-7890'},
    {ID:2,FIRSTNAME:'B',LASTNAME:'C',EMAIL:'b@c.com',PASSWORD:'b',ADDRESSTYPE:'Work',STREET1:'Lane',STREET2:'',STREET3:'',CITY:'Los Angeles',STATE:'CA',ZIP:'67890',PHONETYPE:'Home',PHONE:'456-789-0123'},
  ];
   
   var userDetail = new Ext.Panel({
     applyTo: 'my',
     width: 350,
     height: 250,
     title: 'Example',
     data: userData[0],
     tpl: new Ext.XTemplate([
       '{FIRSTNAME} {LASTNAME}
',
       '{ADDRESSTYPE} Address',
       '{STREET1}',
       '',
         '{STREET2}',
       '',
       '

{CITY}, {STATE} {ZIP}'
     ]),
     listeners:{
       render:{
         fn: function(el){
           this.tpl.overwrite(this.body,this.data);
         }
       }
     }
   });
});