AnsweredAssumed Answered

TypeError: clazz is not a constructor

Question asked by Nadir_Hussain on Feb 11, 2019
Latest reply on Feb 11, 2019 by rscheitlin

i have two user defined functions.When i declare and call them i get this error.i dont know why it is happening .please help or suggest me how to declare function inside a web app builder widget. Thanks.

startup: function() {
this.inherited(arguments);
var panel = this.getPanel();
panel.position.width = 260;
panel.position.height = 300;
panel.setPosition(panel.position);
panel.panelManager.normalizePanel(panel);


this.FieldsCombo.watch('displayedValue', lang.hitch(this, function(property, oldValue, newValue) {
alert(oldValue+"_________"+newValue);
this.getDistinctValues("https://localhost:6443/arcgis/rest/services/BaseMap/MapServer/"+_strSourceLayer,newValue);---------------------->Error on this line
}));
},
getDistinctValues: function (strURL,strFieldName){
this.getFeatuers(strURL,"1=1", [strFieldName],function(_target){------>  Error on this line
for(var i = 0; i < _target.features.length; i++){
var feat=_target.features[i];
alert(feat[strFieldName]);
}
});
},
getFeatuers: function (URL,where,OUTFields,callback ){
var query = new _Query();
var queryTask = new _QueryTask( URL);
query.where = where;
query.outSpatialReference = _map.spatialReference;
query.returnGeometry = true;
query.outFields = OUTFields;
queryTask.execute(query, callback);
},

});
return clazz;

});

Outcomes