PDA

View Full Version : this.mainBody is undefined



Jamiroquai
20 Aug 2009, 12:01 PM
Don't know for sure why I get this error.
Also FB throws me this other error:
this.config[a] is undefined
The 2 errors are from ext-all.js



Ext.onReady(function(){

var fm = Ext.form;
var cm = new Ext.grid.ColumnModel({
defaults: {
sortable: true
},
columns: [
{
id: "rut",
header: "RUT",
dataIndex: "pre_rut",
width: 10
}, {
header: "Razon Social",
dataIndex: "pre_nombre",
width: 180,
editor: new fm.TextField({
allowBlank: false
})
}, {
header: "Sexo",
dataIndex: "pre_sexo",
width: 130,
editor: new fm.ComboBox({
typeAhead: true,
triggerAction: "all",
transform: "sexo",
lazyRender: true,
listClass: "x-combo-list-small"
})
}, {
header: "Perfil",
dataIndex: "pre_perfil",
width: 130,
editor: new fm.ComboBox({
typeAhead: true,
triggerAction: "all",
transform: "perfil",
lazyRender: true,
listClass: "x-combo-list-small"
})
}, {
header: "Direccion",
dataIndex: "pre_direccion",
width: 170,
editor: new fm.TextField({
allowBlank: false
})
}, {
header: "Telefono",
dataIndex: "pre_telefono",
width: 80,
editor: new fm.TextField({
allowBlank: false
})
}, {
header: "Email",
dataIndex: "pre_mail",
width: 50,
editor: new fm.TextField({
allowBlank: false
})
}, {
header: "Pagina Web",
dataIndex: "pre_web",
width: 50,
editor: new fm.TextField({
allowBlank: false
})
}, {
header: "Rubro",
dataIndex: "pre_rubro",
width: 50,
editor: new fm.TextField({
allowBlank: false
})
}, {
header: "Ficha",
dataIndex: "ficha",
width: 50,
renderer: fichaLnk
}, {
header: "Alta/Baja",
dataIndex: "alta",
width: 50,
renderer: altaBajaLnk
}
]
});

var dsFounded = new Ext.data.Store({
autoDestroy: true,
proxy: new Ext.data.HttpProxy({url: "index.php?etapa=getMant&palabra=", waitMsg: "Buscando..."}),
reader: new Ext.data.JsonReader({},["pre_rut","pre_nombre","pre_sexo","pre_perfil","pre_direccion","pre_telefono","pre_mail","pre_web","pre_rubro","ficha","alta"])
});

dsFounded.load();
var grid = new Ext.grid.EditorGridPanel({
store: dsFounded,
cm: cm,
renderTo: "resultados",
width: 700,
height: 400,
autoExpandColumn: "pre_rut",
title: "LISTADO",
frame: true,
clicksToEdit: 2,
tbar: [{
text: "RESULTADOS"
}]
});

grid.hide();

var simple = new Ext.FormPanel({
labelWidth: 75,
frame:true,
title: "Buscar Pre-Inscripcion",
bodyStyle:"padding:5px 5px 0",
width: 350,
renderTo: "buscando",
defaults: {width: 230},
defaultType: "textfield",
items: [{
fieldLabel: "Texto a Buscar",
name: "busca",
id: "busca",
allowBlank:false
}
],
buttons: [{
text: "Buscar",
handler: function(){
var opc = document.getElementById("busca").value;
if(blancos(opc)){
dsFounded = new Ext.data.Store({
autoDestroy: true,
proxy: new Ext.data.HttpProxy({url: "index.php?etapa=getMant&palabra="+ opc, waitMsg: "Buscando..."}),
reader: new Ext.data.JsonReader({},["pre_rut","pre_nombre","pre_sexo","pre_perfil","pre_direccion","pre_telefono","pre_mail","pre_web","pre_rubro","ficha","alta"])
});
dsFounded.load();
grid.setTitle("Palabra Buscada: "+opc);
grid.show();
}
}
}]
});
});

Jamiroquai
21 Aug 2009, 6:11 AM
Anyone can give some directions?... ty!