[#22,css][s]: add specific div for data explorer to live in in demo (so we are not tied to specific html).

* also minor fix to data table to have th for header row.
This commit is contained in:
Rufus Pollock
2012-01-06 13:02:35 +00:00
parent 6d32ac2b27
commit 08d256816f
3 changed files with 6 additions and 7 deletions

View File

@@ -34,6 +34,7 @@
</div> </div>
<div class="project-controls"></div> <div class="project-controls"></div>
</div> </div>
<div class="data-explorer-here"></div>
<!-- <!--
<div class="main_content"> <div class="main_content">
<div class="left-panel"></div> <div class="left-panel"></div>

View File

@@ -1,7 +1,7 @@
$(function() { $(function() {
// do not like all these window globals ... // do not like all these window globals ...
// window.$container = $('.container .right-panel'); // window.$container = $('.container .right-panel');
window.$container = $('.container'); window.$container = $('.data-explorer-here');
var dataset = demoDataset(); var dataset = demoDataset();
window.dataExplorer = new recline.View.DataExplorer({ window.dataExplorer = new recline.View.DataExplorer({
model: dataset model: dataset

View File

@@ -223,15 +223,15 @@ my.DataTable = Backbone.View.extend({
<table class="data-table" cellspacing="0"> \ <table class="data-table" cellspacing="0"> \
<thead> \ <thead> \
<tr> \ <tr> \
{{#notEmpty}}<td class="column-header"></td>{{/notEmpty}} \ {{#notEmpty}}<th class="column-header"></th>{{/notEmpty}} \
{{#headers}} \ {{#headers}} \
<td class="column-header"> \ <th class="column-header"> \
<div class="column-header-title"> \ <div class="column-header-title"> \
<a class="column-header-menu"></a> \ <a class="column-header-menu"></a> \
<span class="column-header-name">{{.}}</span> \ <span class="column-header-name">{{.}}</span> \
</div> \ </div> \
</div> \ </div> \
</td> \ </th> \
{{/headers}} \ {{/headers}} \
</tr> \ </tr> \
</thead> \ </thead> \
@@ -246,9 +246,7 @@ my.DataTable = Backbone.View.extend({
}, },
render: function() { render: function() {
var self = this; var self = this;
var template = $( ".dataTableTemplate:first" ).html() var htmls = $.mustache(this.template, this.toTemplateJSON());
, htmls = $.mustache(template, this.toTemplateJSON())
;
this.el.html(htmls); this.el.html(htmls);
this.model.currentDocuments.forEach(function(doc) { this.model.currentDocuments.forEach(function(doc) {
var tr = $('<tr />'); var tr = $('<tr />');