所以我已經試過綁定D3表骨幹收集
@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
-1有什麼問題嗎? – Anko