2

I want to edit object's attributes on WFS layer. I see this example http://gis.ibbeck.de/ginfo/apps/OLExamples/OL26/examples/styles_unique_with_group_wfs.html but popup is horrible. I want to use ExtJs form to editing.
So how to edit attributes in this case?

urcm
22.6k4 gold badges59 silver badges109 bronze badges
asked Jul 24, 2012 at 5:08
2
  • Do you know in advance what the feature attributes will be, or do you need to build the form dynamically? Commented Jul 24, 2012 at 8:57
  • I know what attributes get in advance. Commented Jul 24, 2012 at 9:25

1 Answer 1

4

At first need to create store

 st = new GeoExt.data.FeatureStore({
 layer: myVecLayer,
 fields: [
 {name: 'id', type: 'int'}
 ],
 proxy: new GeoExt.data.ProtocolProxy({
 protocol: new OpenLayers.Protocol.WFS({
 version: "1.0.0",
 srsName:"EPSG:900913",
 url: "http://localhost:8080/geoserver/wfs",
 featureType: "filedata_temp",
 featureNS: "http://www.opengeospatial.net/cite",
 filter:Ffilter
 })
 }),
 autoLoad: true
 });

Then EditorGrid

 var cm = new Ext.grid.ColumnModel({
 columns: [
 {header: "id", 
 dataIndex:"id",
 editor: new Ext.form.TextField({allowBlank: false})
 }]
 })
var ed_tab = new Ext.grid.EditorGridPanel({
 store: st,
 region: 'center',
 cm: cm,
 height: 200,
 title:'Аттрибуты',
 autoScroll: true,
 bbar:[{
 xtype: 'tbbutton',
 cls: 'x-btn-icon',
 tooltip: "Сделать что то",
 id: "something",
 icon: url_servlet+'externals/gxp/src/theme/img/silk/delete.png',
 handler: function(){
 ed_tab.store.proxy.protocol.commit(
 myVecLayer.features
 );
 ed_tab.store.reload();
 }
 }]
 })
var x = new Ext.Window({
 title:'Аттрибуты',
 items:[ed_tab] 
 })
 x.show();

That all about attributes. To modifity geometry htere: Modify WFS with OpenLayers

answered Jul 27, 2012 at 8:32

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.