sorting working
diff --git a/planetstack/core/xoslib/static/js/xosDeveloper.js b/planetstack/core/xoslib/static/js/xosDeveloper.js
index 6ea2d59..33c8b7d 100644
--- a/planetstack/core/xoslib/static/js/xosDeveloper.js
+++ b/planetstack/core/xoslib/static/js/xosDeveloper.js
@@ -10,21 +10,24 @@
className: 'developer_slicedetail'
});
-/*
-DeveloperApp.SliceListView = Marionette.CollectionView.extend({
- tagName: "table",
- className: "table table-hover",
- template: "#developer-slicetable-template",
- childView: DeveloperApp.SliceDetailView,
-});
-*/
-
-DeveloperApp.SliceListView = Marionette.CompositeView.extend({
+DeveloperApp.SliceListView = Marionette.CompositeView.extend({
tagName: "table",
className: "table-striped table-bordered",
template: "#developer-slicetable-template",
childView: DeveloperApp.SliceDetailView,
childViewContainer: "tbody",
+
+ events: {"click .sort": "changeSort"},
+
+ changeSort: function(e) {
+ parts=$(e.currentTarget).attr("id").split('-');
+ order=parts[1];
+ fieldName=parts[2];
+ console.log(fieldName);
+ this.collection.sortVar = fieldName;
+ this.collection.sortOrder = order;
+ this.collection.sort();
+ }
});
DeveloperApp.on("start", function() {
@@ -33,7 +36,7 @@
});
console.log(developerSliceListView);
DeveloperApp.mainRegion.show(developerSliceListView);
- xos.slicesPlus.startPolling(); //fetch();
+ xos.slicesPlus.startPolling();
});
$(document).ready(function(){