The "records" widget supports the new optional "summary-template"
authorMike Taylor <mike@indexdata.com>
Tue, 11 Nov 2014 09:41:38 +0000 (09:41 +0000)
committerMike Taylor <mike@indexdata.com>
Tue, 11 Nov 2014 09:41:38 +0000 (09:41 +0000)
setting, which tells it to use a template other than the default
"template" when rendering summary records. For example,
<div class="mkws-records" summary-template='details'></div>
will render all records in detailed view.

src/mkws-widget-main.js

index 70c45e2..c1a58ef 100644 (file)
@@ -128,7 +128,7 @@ mkws.registerWidgetType('records', function() {
       }
     }
     var template = team.loadTemplate(that.config.template || "records");
-    var summaryPartial = team.loadTemplate("summary");
+    var summaryPartial = team.loadTemplate(that.config['summary-template'] || "summary");
     var tdata = $.extend({}, {"hits": data.hits}, that.config.template_vars);
     that.node.html(template(tdata, {"partials":{"summary":summaryPartial}}));
   });