Free cookie consent management tool by TermsFeed Policy Generator

source: branches/OaaS/HeuristicLab.Services.Optimization.Web/Content/job.controller.js @ 9324

Last change on this file since 9324 was 9324, checked in by fschoepp, 11 years ago

#1888:

  • DAL: Added a Delete method which deletes by experiment id.
  • HL DataTables will now be transposed and mapped as double[ROWS][COLUMNS] (transposed)
  • JS: Moved all classes into "modules" to prevent namespace pollution (using OAAS_MODEL for model classes, OAAS_VIEW for views and OAAS_CONTROLLER for controllers)
  • JS: Moved DatatypeMapper classes into Backbone views
  • JS: Models now correctly send DELETE requests
  • Added a new job overview page (which also renders run details) using AJAX
  • Using moment.min.js to format DateTime as string
  • Controllers now inherit from BaseController which provides a RedirectToLoginIfNecessary-method
  • Added loading animations to several AJAX bound places (loading experiments / scenarios)
  • Added a section to _Layout.cshtml which allows page-specific JavaScript includes (<script> only for a certain page)
  • Fixed Build/Edit of experiment menu redirecting to the wrong page
  • The Experiment Variation Dialog disables input fields, if the property has not been activated before
File size: 1.5 KB
Line 
1var OAAS_CONTROLLER = (function (my, Backbone, OAAS_VIEW, OAAS_MODEL, _, $) {
2    my.JobPageController = function () {
3        this.create = function () {
4            var self = this;
5            var jobList = new OAAS_MODEL.JobList();
6            var jobOverview = new OAAS_VIEW.JobOverView({ collection: jobList, el: $('#jobOverview') });
7
8            var listener = {};
9            // add listener capabilities to instance
10            _.extend(listener, Backbone.Events);
11
12            listener.listenTo(jobList, 'updated', function (evt) {
13                // refresh overview
14                jobOverview.render();
15            });
16
17            listener.listenTo(jobOverview, 'jobSelected', function (jobId) {
18                var runList = new OAAS_MODEL.RunList({ jobId: jobId });
19                var lv = new OAAS_VIEW.LoadingView({ el: $('#jobDetails'), model: 'Loading results of job...' });
20                lv.render();
21                runList.fetch({ cache: false, success: function () {
22                    $('#jobDetails').empty();
23                    var div = $('<div/>').appendTo($('#jobDetails'));
24                    var rv = new OAAS_VIEW.ResultView({ model: runList, el: div });
25                    rv.render();
26                    var av = new OAAS_VIEW.AccordionView({ el: div });
27                    av.render();
28                }
29                });
30            });
31
32            jobList.poll();
33        }
34    }
35    return my;
36} (OAAS_CONTROLLER || {}, Backbone, OAAS_VIEW, OAAS_MODEL, _, $));
Note: See TracBrowser for help on using the repository browser.