Ver Mensaje Individual
  #3 (permalink)  
Antiguo 05/11/2011, 09:40
lizz17_87
 
Fecha de Ingreso: febrero-2011
Mensajes: 38
Antigüedad: 13 años, 2 meses
Puntos: 1
Respuesta: cómo insertar nuevos campos editables en un grid editable en ExtJs

Aqui esta el codigo del grid editable, las columnas y el panel donde esta el grid




columnasEditable = new Ext.grid.ColumnModel(
[{
header: 'Tipo de Interes',
dataIndex: 'Tipo de Interes',
width: 120,
editor: new Ext.form.ComboBox({
name: 'tipoInteres',
id: 'tipoInteres',
hiddenName: 'htipoInteres',
fieldLabel: 'Tipo Interes',
store: dataTipoInteres,
valueField: 'idtipoInteres',
//displayField:'descripcion',
width: 120,
mode: 'remote',
triggerAction: 'all',
emptyText: 'Seleccione...'
})
},{
header: 'Fecha',
dataIndex: 'Fecha',
width: 120,
editor: new Ext.form.DateField({
allowBlank: false
})
},{
header: 'Monto',
dataIndex: 'Monto',
width: 120,
editor: new Ext.form.TextField({
allowBlank: false
})
},{
header: "Dias",
dataIndex: 'Dias',
width: 120,
align: 'center',
editor: new Ext.form.TextField({
allowBlank: false
})
},
{
header: "Tasa",
dataIndex: 'Tasa',
width: 120,
align: 'center',
editor: new Ext.form.TextField({
allowBlank: false
})
},
{
header: "Total",
dataIndex: 'Total',
width: 120,
align: 'center',
editor: new Ext.form.TextField({
allowBlank: false
})
}
]
);

var xPagingBarEditable = new Ext.PagingToolbar({
pageSize: 15,
//store: datosEditable,
displayInfo: true,
displayMsg: 'Mostrando registros: {0} - {1} de {2}',
emptyMsg: "No existen registros para mostrar"
});


gridLiquidacion = new Ext.grid.EditorGridPanel({
title: 'Detalles',
id: 'gridLiquidacion',
//store: datosEditable,
cm: columnasEditable,
width:600,
height:150,
bbar: xPagingBarEditable,
tbar:{
defaults:{scope:this},
items:[
{text:'Save changes',iconCls:'save-icon',handler:this.save}
]
}, clicksToEdit: 1,
enableHdMenu: true,
stripeRows: true
});


var panelLiquidacion = new Ext.Panel({
title: 'Detalles',
width: 870,
height: 250,
defaults:{
border: false,
bodyStyle: 'padding: 20px;'
},
tbar:{
items:[
{text:'Guardar',iconCls:'save-icon',handler:{}},
{text:'Nuevo',iconCls:'add-icon',handler:{}} // add button
]
},
renderTo: 'liquidacion',
items: [gridLiquidacion]
});

});