[Users] code works with ExtJS v2.2.1 but not v3.0.0

Gary White gary_white at verizon.net
Sun Dec 20 14:45:27 CET 2009


I've been pulling my hair out trying to get the attached code to work with
ExtJS v3.0.0.  It works fine with 2.2.1 but I get the following error with
3.0.0: 

 

Error: this.el is undefined

Source File: http://extjs.cachefly.net/ext-3.0.0/ext-all-debug.js

Line: 40920

 

I've narrowed it down to the following bits (below the sig).
"selFeatCtl"-in addition to being used as the selectControl for the
FeatureSelectionModel in the GridPanel-is also used as the control for a
GeoExt.Action (not shown below but is in the attached code).  The code works
under 3.0.0 if I just use the plain GeoExt.grid.FeatureSelectionModel()
constructor for the sm in the GridPanel (but of course then the
featurehighlighted handler doesn't work).

 

Any help is greatly appreciated,

Gary

 

    var selFeatCtlCfg = {

        type: OpenLayers.Control.TYPE_TOGGLE,

        hover: true,

        eventListeners: {

            featurehighlighted : function(evt) {

                var feat = evt.feature;

                var map = feat.layer.map;

                var coord = new OpenLayers.LonLat(feat.geometry.x,
feat.geometry.y);

                if (!map.getExtent().containsLonLat(coord))

                    map.panTo(coord);

            }

        }

    } ;

 

    var selFeatCtl = new OpenLayers.Control.SelectFeature(vecLayer,
selFeatCtlCfg);

 

    var selModel = new GeoExt.grid.FeatureSelectionModel({selectControl :
selFeatCtl});

 

    // create grid panel configured with feature store

    gridPanel = new Ext.grid.GridPanel({

        title: "Feature Grid",

        region: "east",

        store: store,

        width: 500,

        columns: [

            {

                header: "ID",

                width: 50,

                dataIndex: "id"

            },

            {

                header: "Latitude",

                width: 200,

                dataIndex: "latitude"

            },

            {

                header: "Longitude",

                width: 200,

                dataIndex: "longitude"

            }

        ],

//        sm: new GeoExt.grid.FeatureSelectionModel()

        sm: selModel

    });

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20091220/93f81e2f/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: feature-grid.zip
Type: application/x-zip-compressed
Size: 3005 bytes
Desc: not available
Url : http://www.geoext.org/pipermail/users/attachments/20091220/93f81e2f/attachment.bin 


More information about the Users mailing list