Christus Data Dictionary w/ Templates

by siegesan

HTML

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/3.0.2/handlebars.min.js"></script>
<script src="https://chriszarate.github.io/sheetrock/dist/sheetrock.min.js"></script>
<h4>Christus Health Plans Reports Data Dictionary</h4>

<table class="table-striped table">
    <tr>
        <th>Field ID</th>
        <th>Field Name</th>
        <th>Description</th>
        <th>Report Usage</th>
    </tr>
    <tbody id="dd"></tbody>
</table>
<script id="dd-template" type="text/x-handlebars-template">
    <tr> 
        <td> {{cells.CanonicalReportName}} - {{cells.ID}} </td>
        <td title="{{cells.DisplayLabel}}">{{cells.Variable}}</td >
        <td>{{cells.Definition}}</td>
        <td> {{cells.Usage}} </td>
    </tr>
</script>

JavaScript

// Sheetrock.js 1.0 Example 3
// https://chriszarate.github.io/sheetrock/

// Let’s generate an ordered list by passing in a Handlebars template. 
// This time we’ll rank the top five players by home runs.

// Define spreadsheet URL.
var mySpreadsheet = 'https://docs.google.com/spreadsheets/d/1jO6o3Fo0NV9Y6EKmYl_OTEMbuBcFgYcMemnyX3Ruyy4/edit#gid=0';

// Compile the Handlebars template for HR leaders.
var DDTemplate = Handlebars.compile($('#dd-template').html());

// Load top five HR leaders.
$('#dd').sheetrock({
    url: mySpreadsheet,
    //query: "select A,B,C,D,E order by B",
    //fetchSize: 100,
    rowTemplate: DDTemplate
});