No need to invoke resetPage() before reShow(), which will do it for us.
[mkws-moved-to-github.git] / src / mkws-widgets.js
index b5d1373..6370952 100644 (file)
@@ -10,7 +10,7 @@ function widget($, team, type, node) {
        team: team,
        type: type,
        node: node,
-       config: Object.create(team.config())
+       config: mkws.objectInheritingFrom(team.config())
     };
 
     function log(s) {
@@ -288,7 +288,6 @@ mkws.registerWidgetType('Sort', function() {
     $(this.node).change(function() {
        that.team.set_sortOrder($(that.node).val());
        if (that.team.submitted()) {
-           that.team.resetPage();
            that.team.reShow();
        }
        return false;
@@ -302,9 +301,17 @@ mkws.registerWidgetType('Perpage', function() {
     $(this.node).change(function() {
        that.team.set_perpage($(that.node).val());
        if (that.team.submitted()) {
-           that.team.resetPage();
            that.team.reShow();
        }
        return false;
     });
 });
+
+
+mkws.registerWidgetType('Done', function() {
+    var that = this;
+
+    this.team.queue("complete").subscribe(function(n) {
+       $(that.node).html("Search complete: found " + n + " records");
+    });
+});