Solo le coloco saltos de lineas al codigo javascript, y funciona.
Asi no funciona, que es cuando lo llamo con la funcion PHP, y quedaria en el codigo de la pagina asi:
Código HTML:
<script type="text/javascript">
Ext.onReady(function(){var myData = [['15727241','Ricardo','Ríos','[email protected]','ricardorios'],['9792332','Vitaliano','Giannangeli','[email protected]','vgr']];var store = new Ext.data.Store({proxy: new Ext.ux.data.PagingMemoryProxy(myData),remoteSort:true,sortInfo: {field:'cedula', direction:'DESC'},reader: new Ext.data.ArrayReader({fields: [{name:'cedula'},{name:'nombre'},{name:'apellido'},{name:'correo'},{name:'usuario'}]})})var grid = new Ext.grid.GridPanel({store: store, columns: [{id: "cedula", width: 120, sortable: true, dataIndex: 'cedula'}, {header: "nombre", width: 120, sortable: true, dataIndex: 'nombre'},{header: "apellido", width: 120, sortable: true, dataIndex: 'apellido'},{header: "correo", width: 120, sortable: true, dataIndex: 'correo'},{header: "usuario", width: 120, sortable: true, dataIndex: 'usuario'} ], stripeRows: true, autoExpandColumn: 'cedula', height:320, width:600, frame:true, title:'PRUEBA', plugins: new Ext.ux.PanelResizer({ minHeight: 100 }),bbar: new Ext.PagingToolbar({pageSize: 10,store: store,displayInfo: true,plugins: new Ext.ux.ProgressBarPager() })});grid.render('PRUEBA');store.load({params:{start:0, limit:10}});});
</script>
Y asi si funciona
Código HTML:
<script type='text/javascript'>
Ext.onReady(function(){
var myData = [
['15727241','Ricardo','Ríos','[email protected]','ricardorios'],
['9792332','Vitaliano','Giannangeli','[email protected]','vgr']
];
var store = new Ext.data.Store({
proxy: new Ext.ux.data.PagingMemoryProxy(myData),
remoteSort:true,
sortInfo: {field:'cedula', direction:'DESC'},
reader: new Ext.data.ArrayReader(
{fields: [
{name:'cedula'},
{name:'nombre'},
{name:'apellido'},
{name:'correo'},
{name:'usuario'}]
})
})
var grid = new Ext.grid.GridPanel(
{store: store, columns: [
{id: "cedula", width: 120, sortable: true, dataIndex: 'cedula'},
{header: "nombre", width: 120, sortable: true, dataIndex: 'nombre'},
{header: "apellido", width: 120, sortable: true, dataIndex: 'apellido'},
{header: "correo", width: 120, sortable: true, dataIndex: 'correo'},
{header: "usuario", width: 120, sortable: true, dataIndex: 'usuario'}
],
stripeRows: true,
autoExpandColumn: 'cedula',
height:320,
width:600,
frame:true,
title:'PRUEBA',
plugins: new Ext.ux.PanelResizer({
minHeight: 100
}),
bbar: new Ext.PagingToolbar({
pageSize: 10,
store: store,
displayInfo:
true,plugins: new Ext.ux.ProgressBarPager()
})
});
grid.render('PRUEBA');
store.load({params:{start:0, limit:10}});
});
</script>