define([
'jquery',
'underscore',
'backbone',
'collections/jobs',
'text!templates/jobs/list.html'
], function($, _, Backbone, JobCollection, JobListTemplate){
var JobWidget = Backbone.View.extend({
el: '#bbJobList',
initialize: function () {
_.bindAll(this, 'detect_scroll');
$(window).scroll(this.detect_scroll);
this.isLoading = false;
this.jobCollection = new JobCollection();
},
render: function () {
this.loadResults();
},
loadResults: function () {
var that = this;
// we are starting a new load of results so set isLoading to true
this.isLoading = true;
this.jobCollection.fetch({
success: function (jobs) {
$(that.el).append(_.template(JobListTemplate, {jobs: jobs.models, _:_}));
// Now we have finished loading set isLoading back to false
that.isLoading = false;
}
});
},
close: function(){
this.remove();
this.unbind();
}
});
return JobWidget;
});
How do i remove RELOAD render after i close it? I'm planning to Re-Render , the update data are in model which i will grab out from controller(If it's possible)
I tried
this.render()