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.

I convert database query result into json format.But this json data not populate on feature grid, Not showing any errors.not able to understand the error.please tell me what is wrong with this code I am using Geoserver,Openlayers,PostGIS,GeoExt,Gxp

This is Js page

    addOutput: function() {


     var vecLayer = new OpenLayers.Layer.Vector("vector");
        map.addLayers([vecLayer]);

     return gxp.plugins.fsi_query.superclass.addOutput.call(this,{
         xtype: 'form',
         border: false,
         bodyStyle: "padding: 10px",
         width:300,
         items:[{xtype: 'textfield',

             fieldLabel: 'Enter From Date',

             id:'Dftext'
             },
             {xtype: 'textfield',

            fieldLabel: 'Enter To Date',

             id:'Dttext'
             },
        {xtype: 'textfield',

     fieldLabel: 'Enter  From depth',

      id:'De1text'
          },
     {xtype: 'textfield',

      fieldLabel: 'Enter To depth',

     id:'De2text'
         }],
         bbar: [{
             text: "Query FSI",
             iconCls: "gxp-icon-fsiquery",
             handler: function() {

                 var fdate = Ext.getCmp('Dftext').getRawValue();
                 var tdate = Ext.getCmp('Dttext').getRawValue();
                 var fdepth = Ext.getCmp('De1text').getRawValue();
                 var tdepth = Ext.getCmp('De2text').getRawValue();

                 // create feature store, binding it to the vector layer
                   var store = new GeoExt.data.FeatureStore({
                        layer: vecLayer,
                        fields: [ {name: 'depth', type: 'string'},
                                {name: 'species_name', type: 'string'},
                                {name: 'total_catch', type: 'integer'},
                                {name: 'number', type: 'integer'}
                            ],
                        proxy: new GeoExt.data.ProtocolProxy({
                            protocol: new OpenLayers.Protocol.HTTP({
                                url: "http://localhost:8070/FSI/fsi_query.jsp?fdate="+fdate+'&tdate='+tdate+'&fdepth='+fdepth+'&tdepth='+tdepth,

                                format: new OpenLayers.Format.GeoJSON()
                            })
                        }),
                        autoLoad: true
                    });
                   alert("Hai111");
                    // create grid panel configured with feature store
                  var gridPanel = new Ext.grid.GridPanel({
                        title: "Feature Grid",
                        region: "east",
                        store: store,
                        width: 320,
                        columns: [{
                            header: "depth",
                            width: 100,

                            dataIndex: "depth"
                        }, {
                            header: "species_name",
                            width: 40,

                            dataIndex: "species_name"
                        }, {
                            header: "total_catch",
                            width: 40,

                            dataIndex: "total_catch"
                        }, {
                            header: "number",
                            width: 40,

                            dataIndex: "number"
                        }],
                        sm: new GeoExt.grid.FeatureSelectionModel() 
                    });
       }

         }]
     });

}

This is JSON out Put

     ["{"total_catch":120,"geometria":"POINT(92.111.2333333333)","species_name":"Thunnus albacares","number":2,"depth":1100}","{"total_catch":120,"geometria":"POINT(92.1 11.2333333333)","species_name":"Carcarhinus limbatus","number":2,"depth":1100}"]
share|improve this question
 
please,kindly replay for this question. –  Teetu Jan 28 at 10:22
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.