<div class="{{ partial_item.grid_columns }} columns">
    <style>
        .tile-partial > ul {
            list-style: none;
        }
        .tile-partial.partial:hover {
            background: #F7F7F5;
            cursor: pointer;   
        }
        /*
        .tile-partial > ul > li {
            margin-bottom: 0rem;
        }*/
    </style>
    <h4 class="tile-partial partial-heading">
        {{ partial_item.title }}
    </h4>
    <div class="tile-partial partial" id="{{ partial_item.name }}" style="overflow: scroll; height: {{ partial_item.grid_rows * 50}}px;">
   </div>
</div>

<script type="text/javascript">
    $(function () {

        var tileDiv = $('#{{ partial_item.name }}')[0];
        
        var startStreamConfig = {
            table_name: {{ partial_item.table_name|tojson|safe }},
            key_field: {{ partial_item.key_field|tojson|safe }},
            restrict_by: {{ partial_item.restrict_by|tojson|safe }},
            start_key: {{ partial_item.start_key|tojson|safe }},
            start_item_number: {{ partial_item.start_item_number|tojson|safe }},
            count: {{ partial_item.count|tojson|safe }},
            end_key: {{ partial_item.end_key|tojson|safe }},
            stream_tag: {{ partial_item.stream_tag|tojson|safe }}
        };

        var tileStream = new Stream(socket, startStreamConfig, (data) => {
            var innerHTML = "<ul>";
            for (var key in data) {
                innerHTML += "<li> <strong>" + key + ": </strong><em>" + data[key]+ "</em></li>";
            }
            innerHTML += "</ul>";
            tileDiv.innerHTML = innerHTML;
        }); 
        tileStream.startStream();
    });
</script>