hi i m using the below code .Kindly help me.


on error console i m getting dom is undefined on second click of add button.


Rhub.ShortCodeTranslation = function(){



this.Form = function(e){
Ext.define('network', {
extend: 'Ext.data.Model',
fields:[
{name: 'Network_ID',mapping:'Network_ID',type: 'string'},
{name: 'Network_NAME',mapping:'Network_NAME',type: 'string'}


]
});
this.F = new Ext.ux.FormBlind(Ext.getCmp('shortcodetranslation-tab'),{

labelWidth:100,
width:310,
defaults:{width:200},
waitMsgTarget:true,
defaultType:'textfield',
items: [{
xtype:'combo',
fieldLabel:'Network Name',
name:'Network_Id',
id:'Network_Id',
allowBlank:false,

store: Ext.create('Ext.data.Store', {
model: 'network',
autoLoad: true,
proxy: {
type: 'ajax',
url: 'ShortCodeTranslation?action=network'


}
}),
anchor:'100%',
displayField:'Network_NAME',
valueField:'Network_ID',
hiddenName:'Network_ID',
editable:false,
typeAhead:true,
queryMode: 'local',

emptyText:'Select Network Name',
selectOnFocus:true,
allowblank:false


},{
xtype:'combo',
fieldLabel:'Subscription Type',
name:'Sub_Type',
id:'Sub_Type',
allowBlank:false,
store: new Ext.data.SimpleStore({
autoLoad:true,
fields:[ {name:'Account_ID'}, {name:'Account_NAME'} ],
data: [['1', 'Prepaid'], ['2', 'Postpaid']]
}),
anchor:'100%',

displayField:'Account_NAME',
valueField:'Account_NAME',
hiddenName:'Account_NAME',
editable:false,
typeAhead:true,
mode:'local',
triggerAction:'all',
emptyText:'Select Subscription Type',
selectOnFocus:true
},{
xtype: 'textfield',
fieldLabel: 'Short Code',
anchor: '100%',
name: 'ShortCode',
id:'ShortCode' ,
allowblank:false
},
{
xtype: 'textfield',
fieldLabel: 'Translation ShortCode',
anchor: '100%',
name: 'TrancCode',
id:'TrancCode' ,
allowblank:false
}],
buttons:[{
text:'Cancel',
iconCls:'cancel',
scope:this,
handler:function(){
this.F.dismiss();this.Grid.store.loadPage(1);

}
},{
text:'Save',
iconCls:'save',
scope:this,
handler:function(){

this.F.getForm().submit({
url:'ShortCodeTranslation',
params:{action:'insert'},
scope:this,
success:function(form, action){
var json = Ext.decode(action.response.responseText);
//var respstatus=Ext.util.JSON.decode(action.response.responseText).status;
this.F.dismiss();
this.Grid.store.loadPage(1);
Ext.Msg.show({
title:'Information',
msg:json.status,
buttons:Ext.Msg.OK,
modal:false
});
},
failure:function(form, action){
var json = Ext.decode(action.response.responseText);
//var respstatus=Ext.util.JSON.decode(action.response.responseText).status;
Ext.Msg.show({
title:'Information',
msg:json.status,
buttons:Ext.Msg.OK,
modal:false
});
}
});

}
}]
});
this.F.show();


}
this.Remove = function(){
var seletionModel = this.Grid.getSelectionModel()
var sel = this.Grid.getSelectionModel().getSelection() ;
if(sel[0] == undefined){
Ext.Msg.show({
title:'Information',
msg:'Select any Configuration to delete.',
buttons:Ext.Msg.OK,
modal:false
});
}else{
Ext.Msg.show({
title:'Delete?',
msg:'Are you sure you want to delete?',
buttons:Ext.Msg.YESNO,
modal:false,
scope:this,
fn:function(b,t){
if(b == 'yes'){
Ext.Ajax.request({
url:'ShortCodeTranslation',
params:{action:'delete',Snoel[0].get('Sno'),Network_Idel[0].get('Network_Name'),Sub_Typeel[0].get('Subscriber_Type'),ShortCodeel[0].get('ShortCode'),TrancCodeel[0].get('TranslationCode')},
method:'POST',
scope:this,
success:function(result,request){
var json = Ext.decode(result.responseText);
this.Grid.store.remove(sel);
this.Grid.store.loadPage(1);
Ext.Msg.show({
title:'Information',
msg:json.status,
buttons:Ext.Msg.OK,
modal:false
});
},
failure:function(result,request){
var json = Ext.decode(result.responseText);
Ext.Msg.show({
title:'Information',
msg:json.status,
buttons:Ext.Msg.OK,
modal:false
});
}
});
}else{

}
}
});
}
}


Ext.define('User', {
extend: 'Ext.data.Model',
fields:[
{name: 'Sno',mapping:'Sno',type: 'string'},
{name: 'Network_Name',mapping:'Network_Name',type: 'string'} ,
{name: 'Subscriber_Type',mapping:'Subscriber_Type',type: 'string'},
{name: 'ShortCode',mapping:'ShortCode',type: 'string'} ,
{name: 'TranslationCode',mapping:'TranslationCode',type: 'string'} ,

]
});


var ShortcodeStore = Ext.create('Ext.data.Store', {
autoLoad:true,
model:User,
proxy:new Ext.data.HttpProxy({
root:'userdata',
totalProperty:'results',
url: 'ShortCodeTranslation?action=view',
method:'post',
reader: {
type : 'json',
root : 'userdata',
totalProperty:'results'
}


})
});
ShortcodeStore.load();

this.UserManager_pagbar=new Ext.PagingToolbar({
pageSize:10,
store:this.ShortcodeStore,
displayInfo:true,
emptyMsg:'No Data Found to Display',
displayMsg:'Displaying {0}-{1} of {2}',
enableToggle:true

});


this.Grid = new Ext.grid.GridPanel({
viewConfig:{forceFit:true},
minColumnWidth:5,
loadMask: {msg:'Loading Data...'},
region:'center',
layout:'fit',
border:false,
store:ShortcodeStore,
columns:[
{text: 'Sno',sortable:true,dataIndex: 'Sno'},
{text: 'Network Name',sortable:true,dataIndex: 'Network_Name'},
{text: 'Subscriber Type',sortable:true,dataIndex: 'Subscriber_Type'},
{text: 'ShortCode',sortable:true,dataIndex: 'ShortCode'},
{text: 'TranslationCode',sortable:true,dataIndex: 'TranslationCode'}
],
tbar:[{
text:'Add',
iconCls:'add',
scope:this,
handler:this.Form


},{
text:'Delete',
iconCls:'delete',
scope:this,
handler:this.Remove
}
]



});


this.Tab = new Ext.Panel({
title:'Short Code Translation',
iconCls:'users',
layout:'border',
border:false,
closable:true,
id:'shortcodetranslation-tab',
items:this.Grid


});


}
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/