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 container = this._div.empty();
var divSummary = $('<div></div>').addClass("viewPanel-summary").appendTo(container); var divSummary = $('<div></div>').addClass("viewPanel-summary").appendTo(container);
$('<span>' +
(theProject.rowModel.start + 1) + " to " + var summaryText;
Math.min(theProject.rowModel.filtered, theProject.rowModel.start + theProject.rowModel.limit) + " of " +
(theProject.rowModel.filtered) + " filtered rows, " + var from = (theProject.rowModel.start + 1);
(theProject.rowModel.total) + " total rows" + var to = Math.min(theProject.rowModel.filtered, theProject.rowModel.start + theProject.rowModel.limit);
'</span>' if (theProject.rowModel.filtered == theProject.rowModel.total) {
).appendTo(divSummary); 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 * 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 pagingControls0 = pagingControls[0].rows[0].cells[0];
var pagingControls1 = pagingControls[0].rows[0].cells[1]; var pagingControls1 = pagingControls[0].rows[0].cells[1];

View File

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