所以我试过了
@table = d3.select("#search-results-area").append("table").attr("id","resultsTable").attr("class","visualization-panel")
@thead = @table.append("thead")
@tbody = @table.append("tbody")
@thead.append("tr").selectAll("th").data(@columns).enter().append("th").text((col)-> return col).on("click",(d)=>@tbody.selectAll("tr").sort(@sortingFunctionManager[d]))
@tbody.selectAll("tr").attr("class","spacing center-text")
console.log "tbody"
console.log
@rows = @tbody.selectAll("tr").data(@collection.models).append("tr")
console.log @rows
console.log @collection.models
cells = @rows.selectAll("td").data((model)=>
console.log "inside callback"
console.log model
return @columns.map((column)=>
return { column : column, val : model.get(column)}
)
).enter().append("td").text((d)=>
console.log "what is d"
console.log d
for column in @columns
if d.column == column
return d.val
)
单元格不会附加。其实没有trs