Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

How to display numberoffeatures in map using geoext on grid?

 Ext.onReady(function() {            
            app = new Ext.Viewport({
                layout: "border",
                items: items

        xtype: "grid",
        ref: "capsGrid", // makes the grid available as app.capsGrid
        title: "Available Layers",
        region: "north",
        height: 150,
        viewConfig: {forceFit: true},
        store: new GeoExt.data.WFSCapabilitiesStore({
                url: "http://localhost:8080/geoserver/wfs?request=GetFeature&typename=GisData:sites&version=1.1.1&resultType=hits&filter=(%3CFilter%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3EVendor%3C/PropertyName%3E%3CLiteral%3EvendorTE%3C/Literal%3E%3C/PropertyIsEqualTo%3E%3C/Filter%3E)",
                protocolOptions: {version: "1.1.1"},
                autoLoad: true
        columns: [
            {header: "numberOfFeatures", dataIndex: "numberOfFeatures", sortable: true}

I get xml response in firebug: enter image description here

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Well there are no component to do this job but I found that I can make up my custom component using ExtJS window and ExtJS Grid: Following is sample:

             var t = xmlDoc.getElementsByTagName("FeatureCollection");//for firefox it's "wfs:FeatureCollection"                     
             cnt = t[0].getAttribute("numberOfFeatures");

Now this can be used in geoext grid panel with getLengendGraphic request to geoserver. http://docs.geoserver.org/latest/en/user/services/wms/get_legend_graphic/legendgraphic.html

Information about creating ExtJS grid with image can be found at:


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.