Ya solucionado el tema de la carga de datos de mi grilla ahora me enfrento a otro problemita mas, esperando que alguno me de una manito para seguir superando los obstaculos que se presentan cuando uno es nuevo en un lenguaje.
La idea es la siguiente: Agregar a cada registro de mi grilla un iconito o imagen que al ser pulsada llame a una ventana nueva que ya existe en otro archivo JS y que la muestre.
he probado con embeber codigo html para crear el boton que dispararia la nueva ventana, peno no me fue de mucha ayuda. Me pueden ayudar? Gracias.
A continuacion pongo el codigo de mi ventanita:
- Código: Seleccionar todo
ABMClientes = Ext.extend(Ext.app.Module, {
id:'abmClientes',
init : function(){
this.launcher = {
text: 'ABM Clientes',
iconCls:'icon-grid',
handler : this.createWindow,
scope: this
}
},
createWindow : function(){
/*Defino el JsonStore*/
var varstore = new Ext.data.JsonStore({
url: 'queryClientes.php',
autoLoad: true,
root: 'datosClientes',
sortInfo: {
field: 'ApeNom',
direction: 'ASC'
},
totalProperty: 'total',
fields: [
{name:'ApeNom', type: 'string'},
{name:'Domicilio', type: 'string'}
]
});
/* */
var desktop = this.app.getDesktop();
var win = desktop.getWindow('abmClientes');
if(!win){
win = desktop.createWindow({
id: 'abmClientes',
title:'Clientes',
width:740,
height:480,
iconCls: 'icon-grid',
shim:false,
animCollapse:false,
constrainHeader:true,
layout: 'fit',
items:
new Ext.grid.GridPanel({
id: 'grilla',
border:false,
store : varstore ,
columns: [
{
header: "Apellido y Nombres",
width: 100,
align: 'right',
sortable: false,
dataIndex: 'ApeNom'
},
{
header: "Domicilio",
width: 200,
sortable: false,
dataIndex: 'Domicilio'
},
{
header: 'action',
width: 85,
sortable: false,
renderer:
function(val){
return '<input type="button" value="toto" id="'+val+'" onClick="alert(4); mostrarCliente();"/>';
},
dataIndex: 'somefieldofyourstore'
}
],
viewConfig: {
forceFit:true
}
/*
,
//autoExpandColumn:'company',
tbar:[{
text:'Add Something',
tooltip:'Add a new row',
iconCls:'add'
}, '-', {
text:'Options',
tooltip:'Blah blah blah blaht',
iconCls:'option'
},'-',{
text:'Remove Something',
tooltip:'Remove the selected item',
iconCls:'remove'
}]
*/
})
});
}
win.show();
}
});
function mostrarCliente(ventana)
{
/* ACA DEBERIA LLAMAR A LA VENTANA DEL CLIENTE*/
}

