AnsweredAssumed Answered

no callback from selectFeatures

Question asked by StevenHas on May 30, 2013
Latest reply on Jul 18, 2013 by StevenHas
I'm running a selectFeatures against a table feature layer and there is no callback being generated.
I can see the results returned in the network traffic, and I've created a stripped down application that works, so it's not a service issue.

I'm stumped as to what is happening to my callback so any thoughts will be much appreciated, or anything wrong in the following code (it's within a backbone framework).

I think it's worth noting that a queryFeatures works just fine, so it doesn't seem like something is fundamentally breaking the callbacks. So a backup would be somehow getting the query features result into an attribute inspector related to the layer such that the results could be edited.

Thanks,
Steven

        initialize: function () {
          var _this = this;
          this.featureLayer = new esri.layers.FeatureLayer(this.layerConfig.url, {
            mode: this.layerConfig.mode, //MODE_ONDEMAND
            id: this.id,
            isEditable: 'true',
            outFields: ["*"]
          });

          dojo.connect(this.featureLayer, 'onLoad', function () {
            console.log('featureLayer onLoad called');
            _this.initEditing();
          });
        }


      initEditing: function(){
        var definition = "LIGHT_ID" + " = 'RSL-000002'"
        var query = new esri.tasks.Query();
        query.where = definition;

        var layer  = this.map._layers[this.id];

        layer.selectFeatures(query, esri.layers.FeatureLayer.SELECTION_NEW,
          function (success) {
            console.log('select success');
          }, function (error) {
            console.log('select error');
        });
      }

Outcomes