PDA

View Full Version : Error while loading a windows form...



agustincba
6 Sep 2011, 11:46 AM
Hi to all the Users !. My name is Agustin and I live in Cordoba, Argentina !. My problem is the following one...
I have a gridpanel and a contextmenu... When the event "rowcontextmenu" is fired, a context menu appear with the option of modifying the row details... To do that, I built a Window in a separate method which I pass as paramether the selected record... The first time I use this, it works and the details are modified (in any row) !; but the second time... I get that all the fields are like gone and all is blank... I hace attached a picture so you can see... the the corresponding window code...

function getRemoveWindow(recRemove)
{
var windowRemove = new Ext.Window({
title: 'Edicion de ' + recRemove.get('nombre')+ ' !!!',
width: 280,
height: 220,
modal: true,
layout: 'form',
resizable: false,
draggable: false,
items:
[
{
xtype: 'textfield',
id: 'nom',
fieldLabel: 'Nombre',
value: recRemove.get('nombre')
},
{
xtype: 'textfield',
id: 'ape',
fieldLabel: 'Apellido',
value: recRemove.get('apellido')
},
{
xtype: 'textfield',
id: 'dni',
fieldLabel: 'D.N.I.',
value: recRemove.get('dni')
},
{
xtype: 'numberfield',
id: 'edad',
fieldLabel: 'Edad',
value: recRemove.get('edad')
}
],
bbar:
[
'->',
{
text: 'Guardar',
handler: function ()
{
var nom = Ext.getCmp('nom').getValue();
var ape = Ext.getCmp('ape').getValue();
var dni = Ext.getCmp('dni').getValue();
var edad = Ext.getCmp('edad').getValue();

if(edad === '' || nom === '' || ape === '' || dni === '')
{
Ext.MessageBox.alert('Error','Deberia ingresar algo !');
}
else
{
recRemove.set('nombre',nom);
recRemove.set('apellido',ape);
recRemove.set('dni',dni);
recRemove.set('edad',edad);

windowRemove.hide();
}
}
}
]
});

windowRemove.show();
}