New file mkws-widget-builder.js
authorMike Taylor <mike@indexdata.com>
Wed, 16 Apr 2014 14:15:31 +0000 (15:15 +0100)
committerMike Taylor <mike@indexdata.com>
Wed, 16 Apr 2014 14:15:31 +0000 (15:15 +0100)
src/mkws-widget-builder.js [new file with mode: 0644]

diff --git a/src/mkws-widget-builder.js b/src/mkws-widget-builder.js
new file mode 100644 (file)
index 0000000..fb8491c
--- /dev/null
@@ -0,0 +1,20 @@
+mkws.registerWidgetType('Builder', function() {
+    var team = this.team;
+
+    this.button = $('<button/>', {
+        type: 'button',
+        text: this.config.text || "Build!"
+    });
+    $(this.node).append(this.button);
+    this.button.click(function() {
+        var   query = team.widget('Query').value();
+        var    sort = team.widget('Sort').value();
+        var perpage = team.widget('Perpage').value();
+
+        var html = ('<div class="mkwsRecords" ' +
+                    'autosearch="' + query + '" ' +
+                    'sort="' + sort + '" ' +
+                    'perpage="' + perpage + '"></div>');
+        alert(html);
+    });
+});