我正在尝试渲染一个包含四列的表格视图,“姓名”、“生日”、“性别”、“已婚”,但是
a)它们的列根本没有显示 b)我什至不确定我是否正确传递它们,因为当我 console.log table.options 列属性呈现为“空”:
Object {columns: Array[0], emptyContent: "no entries", onItemClick: function, sortable: false, onSort: null}
我试过这个:
var table = new Backbone.UI.TableView({
model: people,
columns: [
{ title: "Name", content: 'name' },
{ title: "Gender", content: "gender" } },
{ title: "Birthday", content: "birthday" } },
{ title: "Married", content: "married" } }
]
});
和这个:
var table = new Backbone.UI.TableView({
model: people,
options: {
columns: [
{ title: "Name", content: 'name' },
{ title: "Gender", content: "gender" },
{ title: "Birthday", content: "birthday" },
{ title: "Married", content: "married" }
]
}
});