Summary template name is taken from that.config.template if provided
authorMike Taylor <mike@indexdata.com>
Thu, 3 Apr 2014 16:05:26 +0000 (17:05 +0100)
committerMike Taylor <mike@indexdata.com>
Thu, 3 Apr 2014 16:05:26 +0000 (17:05 +0100)
(falling back to the old default of "Summary"). Allows multiple
records widgets to display different formats.

src/mkws-widgets.js

index 312bfab..0f58002 100644 (file)
@@ -304,7 +304,7 @@ mkws.registerWidgetType('Records', function() {
        $(that.node).html(html.join(''));
 
        function renderSummary(hit) {
        $(that.node).html(html.join(''));
 
        function renderSummary(hit) {
-           var template = team.loadTemplate("Summary");
+           var template = team.loadTemplate(that.config.template || "Summary");
            hit._id = team.recordElementId(hit.recid[0]);
            hit._onclick = "mkws.showDetails('" + team.name() + "', '" + hit.recid[0] + "');return false;"
            return template(hit);
            hit._id = team.recordElementId(hit.recid[0]);
            hit._onclick = "mkws.showDetails('" + team.name() + "', '" + hit.recid[0] + "');return false;"
            return template(hit);