Skip to content

Commit

Permalink
[#49] introduce colspan to data table group cell
Browse files Browse the repository at this point in the history
  • Loading branch information
NickQiZhu committed Sep 6, 2012
1 parent dc6391e commit 23632af
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions dc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2140,6 +2140,7 @@ dc.dataTable = function(parent, chartGroup) {
.attr("class", "group")
.append("td")
.attr("class", "label")
.attr("colspan", _columns.length)
.text(function(d) {
return _chart.keyAccessor()(d);
});
Expand Down
4 changes: 2 additions & 2 deletions dc.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/data-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ dc.dataTable = function(parent, chartGroup) {
.attr("class", "group")
.append("td")
.attr("class", "label")
.attr("colspan", _columns.length)
.text(function(d) {
return _chart.keyAccessor()(d);
});
Expand Down
3 changes: 3 additions & 0 deletions test/data-table-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ suite.addBatch({
'order should be set':function(chart) {
assert.equal(chart.order(), d3.ascending);
},
'should have column span set on group tr':function(chart) {
assert.equal(chart.selectAll("tr.group td")[0][0].getAttribute("colspan"), "2");
},
'should have id column created':function(chart) {
assert.equal(chart.selectAll("td.0")[0][0].innerHTML, 8);
assert.equal(chart.selectAll("td.0")[0][1].innerHTML, 3);
Expand Down

0 comments on commit 23632af

Please sign in to comment.