"use strict";
/**
* JSLink: View Customization
*/
var GDView = (function () {
/**
* Methods
*/
// Method to add tags above and below the body
function body(ctx) {
// Render the default html
var html =
"
Above Body |
" +
(RenderBodyTemplate ? RenderBodyTemplate(ctx) : "") +
"Below Body |
";
// Return the html
return html;
}
// Method to add tags above and below the footer
function footer(ctx) {
// Render the default html
var html = "Above Footer
" +
RenderFooterTemplate(ctx) +
"Below Footer
";
// Return the html
return html;
}
// Method to add tags above and below the group
function group(ctx, group, groupId, listItem, listSchema, level, expand) {
var style = " ";
// Get the default group
var html = RenderGroupTemplate(ctx, group, groupId, listItem, listSchema, level, expand);
// Convert the html to an element
var group = document.createElement("table");
group.innerHTML = html;
// Append rows above and below the group
var row = group.querySelector("tr");
row.innerHTML =
"Before Group | " +
row.innerHTML +
"After Group | ";
// Return the html
return group.innerHTML;
}
// Method to add tags above and below the header
function header(ctx) {
// Render the default html
var html =
"Above Header
" +
RenderHeaderTemplate(ctx) +
"Below Header
";
// Return the html
return html;
}
// Method to add tags above and below the item
function item(ctx) {
// Render the default html
var html =
"Above Item |
" +
RenderItemTemplate(ctx) +
"Below Item |
";
// Return the html
return html;
}
/**
* Initialization
*/
function init() {
// Register the JSLink templates
$REST.Helper.JSLink.register({
BaseViewId: 2,
Templates: {
Body: body,
Footer: footer,
Group: group,
Header: header,
Item: item
}
});
}
/**
* Public Interface
*/
return {
init: init
};
})();
// Write the javascript to initialize the CSR override. This will ensure it's called when MDS is enabled
document.write("");