Grid Extjs
Publicado por zaraki (1 intervención) el 01/12/2012 18:17:48
My Grid no se recarga cuando elimino un usuario, por favor ayuda ??????
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
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();
}
Valora esta pregunta


0