Styled data table view summary a bit to highlight current number of rows.

git-svn-id: http://google-refine.googlecode.com/svn/trunk@132 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
David Huynh 2010-02-23 19:18:25 +00:00
parent 4bdb2320b7
commit 2eb3a67125
2 changed files with 18 additions and 8 deletions

View File

@ -21,19 +21,24 @@ DataTableView.prototype.render = function() {
var container = this._div.empty();
var divSummary = $('<div></div>').addClass("viewPanel-summary").appendTo(container);
$('<span>' +
(theProject.rowModel.start + 1) + " to " +
Math.min(theProject.rowModel.filtered, theProject.rowModel.start + theProject.rowModel.limit) + " of " +
(theProject.rowModel.filtered) + " filtered rows, " +
(theProject.rowModel.total) + " total rows" +
'</span>'
).appendTo(divSummary);
var summaryText;
var from = (theProject.rowModel.start + 1);
var to = Math.min(theProject.rowModel.filtered, theProject.rowModel.start + theProject.rowModel.limit);
if (theProject.rowModel.filtered == theProject.rowModel.total) {
summaryText = from + ' to ' + to + ' of <span class="viewPanel-summary-row-count">' + (theProject.rowModel.total) + '</span> rows';
} else {
summaryText = from + ' to ' + to + ' of <span class="viewPanel-summary-row-count">' +
(theProject.rowModel.filtered) + '</span> rows (filtered from ' + (theProject.rowModel.total) + ' rows total)';
}
$('<span>').html(summaryText).appendTo(divSummary);
/*
* Paging controls
*/
var pagingControls = $('<table width="100%"><tr><td align="center"></td><td align="center"></td></tr></table>').addClass("viewPanel-pagingControls").appendTo(container);
var pagingControls = $('<table width="100%"><tr><td align="right"></td><td align="right"></td></tr></table>').addClass("viewPanel-pagingControls").appendTo(container);
var pagingControls0 = pagingControls[0].rows[0].cells[0];
var pagingControls1 = pagingControls[0].rows[0].cells[1];

View File

@ -49,6 +49,11 @@ img.column-header-menu {
.viewPanel-summary {
}
.viewPanel-summary-row-count {
font-size: 150%;
font-weight: bold;
}
.viewPanel-pagingControls {
text-align: center;
margin: 1em 0;