[Users] Grid Paging not works

antoniofacno antoniofcano at gmail.com
Mon Nov 8 14:23:54 CET 2010


Hello,

I've got a Vector layer wich loaded from GeoServer using a ProtocolProxy 
and GML format. The grid shows all features (not the pageSize limit) of 
the layer, and I can see the pager but when click over pager controls it 
loads something but the grid view doesn't change. Is something like both 
stores (grid and pager) were not connected.

My code is this, and I don't know what could be happening :(


         var labores = new OpenLayers.Layer.Vector(
                 "Labores",
                 {
                         displayInLayerSwitcher: false,
                         visibility: false
                 }
         );

         // create feature store, binding it to the vector layer
         var laborStore = new GeoExt.data.FeatureStore({
                 layer: labores,
                 fields: [
                     {name: 'fecha', type: 'date'},
                     {name: 'horas', type: 'float'},
                     {name: 'jornales', type: 'float'},
                     {name: 'cliente', type: 'strig'},
                     {name: 'finca_id', type: 'string'},
                     {name: 'labor', type:'string'}
                 ],
                 proxy: new GeoExt.data.ProtocolProxy({
                     protocol: new OpenLayers.Protocol.HTTP({
                         url: 
"http://getcloud.info:8080/geoserver/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=acano:labores",
                         format: new OpenLayers.Format.GML()
                     })
                 }),
                 autoLoad: true
         });

         var gridPanel = new Ext.grid.GridPanel(
             {
                 title: "Labores",
                 renderTo: "resumen",
                 store: laborStore,
                 autoHeight: true,
                 loadMask: true,
                 columns: [{
                     header: "finca",
                     width: 100,
                     sortable: true,
                     dataIndex: "finca_id"
                 },
                 {
                     header: "cliente",
                     width: 100,
                     sortable: true,
                     dataIndex: "cliente"
                 },
                 {
                     header: "labor",
                     width: 100,
                     sortable: true,
                     dataIndex: "labor"
                 },
                 {
                     header: "fecha",
                     width: 100,
                     sortable: true,
                     renderer: Ext.util.Format.dateRenderer('d/m/Y'),
                     dataIndex: "fecha"
                 }, {
                     header: "horas",
                     width: 100,
                     sortable: true,
                     dataIndex: "horas"
                 },{
                     header: "jornales",
                     width: 100,
                     sortable: true,
                     dataIndex: "jornales"
                 }],
                 sm: new GeoExt.grid.FeatureSelectionModel({
                         layer: labores
                 }),
                 bbar: [],
                 tbar: [new Ext.PagingToolbar({
                     pageSize: 25,
                     store: laborStore,
                     displayInfo: true,
                     displayMsg: 'datos {0} - {1} of {2}',
                     emptyMsg: "No Datos"
                 })]
             }
         );


Best whises,


More information about the Users mailing list