Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FeatureStore with fields config do not work #171

Closed
chrismayer opened this issue Aug 26, 2016 · 0 comments · Fixed by #172
Closed

FeatureStore with fields config do not work #171

chrismayer opened this issue Aug 26, 2016 · 0 comments · Fixed by #172
Labels
Milestone

Comments

@chrismayer
Copy link
Contributor

If you create an instance of GeoExt.data.store.Features with an explicit fields configuration the creation fails in case of connecting a grid with a FeatureRenderer in one of its columns (Mostly like we do in the official FeatureGrid example.

Here is the failing code:

var featStore = Ext.create('GeoExt.data.store.Features',  {
  fields: ['city'],
  layer: vectorLayer,
  map: olMap
});
var grid = Ext.create('Ext.grid.Panel', {
  border: true,
  region: 'east',
  store: featStore,
  columns: [
    {
        xtype: 'widgetcolumn',
        width: 40,
        widget: {
            xtype: 'gx_renderer'
        },
        onWidgetAttach: function(column, gxRenderer, record) {
         // update the symbolizer with the related feature
          var feature = record.olObject;
         gxRenderer.update({
            feature: feature,
            symbolizers: featRenderer.determineStyle(record)
         });
       }
     },
     {text: 'Name', dataIndex: 'city', flex: 2}
 ],
 width: 250
});

In case you remove the fields declaration it works.

A first short look into this topic showed me that the main reason of failing is the fact that the records in the store do not have an olObject. So no feature could be retrieved from the record.

@chrismayer chrismayer added the bug label Aug 26, 2016
@chrismayer chrismayer added this to the v3.0.0 milestone Aug 26, 2016
chrismayer added a commit to chrismayer/geoext3 that referenced this issue Aug 30, 2016
This ensures that the FeatureStore (GeoExt.data.store.Features) uses the
correct model class in case of beeing instanciated with a 'fields'
configuration. Otherwise an implicit model is generated and the reference
to the OL feature in the record is missing (fixes geoext#171).
This also adds some tests and adapts the featuregrid example to show the
fixed behaviour.
chrismayer added a commit to chrismayer/geoext3 that referenced this issue Aug 30, 2016
This ensures that the FeatureStore (GeoExt.data.store.Features) uses the
correct model class in case of beeing instanciated with a 'fields'
configuration. Otherwise an implicit model is generated and the reference
to the OL feature in the record is missing (fixes geoext#171).
This also adds some tests and adapts the featuregrid example to show the
fixed behaviour.
chrismayer added a commit to chrismayer/geoext3 that referenced this issue Aug 30, 2016
This ensures that the FeatureStore (GeoExt.data.store.Features) uses the
correct model class in case of beeing instanciated with a 'fields'
configuration. Otherwise an implicit model is generated and the reference
to the OL feature in the record is missing (fixes geoext#171).
This also adds some tests and adapts the featuregrid example to show the
fixed behaviour.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant