-
Sencha User
Grid no recarga
Estoy haciendo un grid con datos insertados desde un formulario, se insertan bien en la Base de Datos pero no me recarga el grid con los datos insertados.
Nota:Es curioso que la primera vez carga bien y despues no recarga los nuevos datos.
Gracias por la ayuda
Este es el codigo del Grid
Ext.Myjs.Usuario.grid= function()
{
if(Ext.Myjs.Usuario.usu_grid == null){
var sm_report = new Ext.grid.CheckboxSelectionModel();
Ext.Myjs.Usuario.list = new Ext.data.JsonStore({
fields : ['id','nombre','apellido','permiso'],
remoteSort : false,
root : 'rows',
totalProperty : 'total',
url : 'lib/ajax.php',
baseParams : {cmd : 'usuario'//,limit : 20
}
});
var colunModel_entidad = new Ext.grid.ColumnModel([sm_report, {
header : 'ID',
width : 30,
sortable : true,
align : 'center',
dataIndex : 'id',
hidden: true
}, {
header : 'Nombre',
width : 250,
sortable : true,
dataIndex : 'nombre'
},{
header : 'Apellido',
width : 250,
sortable : true,
dataIndex : 'apellido'
},{
header : 'Permisos',
width : 117,
sortable : true,
dataIndex : 'permiso'
}]);
var grid = new Ext.grid.GridPanel({
store : Ext.Myjs.Usuario.list,
width : 653,
height : 400,
frame : true,
tbar : [{
text : 'Nuevo',
icon:'img/botones/add.gif',
iconCls :'noicon',
handler : function(b)
{
Ext.Myjs.Usuario.nuevo();
}
},{
text : 'Borrar',
icon:'img/botones/del.gif',
iconCls :'noicon',
handler : function(b)
{
var selected = sm_report.getSelections();
var ids = new Array();
for (var i = 0; i < selected.length; i++)
ids.push(selected[i].data.id);
Ext.Myjs.Usuario.list.load
({
params:{cmd_tarea: 'eliminar_usuario', ids: Ext.encode(ids)}
});
}
}],
sm : sm_report,
loadMask : true,
cm : colunModel_entidad
});
Ext.Myjs.Usuario.usu_grid = new Ext.Window({
title : 'Usuarios',
width : 665,
autoHeight : true,
resizable : false,
plain : true,
frame : true,
border : false,
items : grid,
closeAction : 'hide',
listeners : {
show : function() {
Ext.Myjs.Usuario.list.load();
}
}
});
}
Ext.Myjs.Usuario.usu_grid.show();
}
-
Sencha User
Estás debuggeando con el firebug?, a mi me pasa con una grilla que no carga bien a la primera y resultó ser un error de el php. Busca en el firebug que envía y que llega para saber más.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules