블록 1 : 초기화 방법은 예상되지만 "SelectIndustry가"this.query 정의되지 않은 블록 (3) * 로부터 호출 될 때 잘 작동 *리셋 컬렉션
ComplienceCollection = Backbone.Collection.extend({
model: Complience,
initialize: function() {
_.bindAll(this, 'selectFeaturesCallback');
vent.bind("onSelectIndustry", this.SelectIndustry);
if(industrylookup == null)
{
industrylookup = "http://hostname/ArcGIS/rest/services/sss/MapServer/2?f=json";
}
this.queryTask = new esri.tasks.QueryTask(industrylookup);
dojo.connect(this.queryTask, 'onComplete', this.selectFeaturesCallback);
this.query = new esri.tasks.Query();
this.query.returnGeometry = false;
this.query.where = '1=1';
this.query.outFields = ['*'];
this.queryTask.execute(this.query);
},
selectFeaturesCallback: function (featureSet) {
var item=_.pluck(featureSet.features, "attributes");
this.reset(item);
},
SelectIndustry: function (oid) {
this.query.where = '1=1';
this.queryTask.execute(this.query);
}
});
블록 2 : 이 다른 백본 기능
vent = _.extend({}, Backbone.Events);
complienceList = new ComplienceCollection();
와 페이지로드 블록 3라고 : 일반에서 호출 자바 스크립트 파일 그것은 특정 모양
vent.trigger("onSelectIndustry",indutrytype);
SelectIndustry에도 바인딩하십시오. _.bindAll (this, 'SelectIndustry'); – Konza