我想使用backgrid.js
在表格单元格中创建一个下拉列表我正在创建以下列:
{ name: "priority",
label: "Priority",
cell: Backgrid.SelectCell.extend({
// It's possible to render an option group or use a
// function to provide option values too.
optionValues: [["one", "a"], ["Two", "b"], ["Three", "c"], ["Four","d"], ["Five", "e"]]
})
}
但这不会呈现Priority
列。它也没有显示下拉列表。
帮帮我,我犯了什么错误?
答案 0 :(得分:0)
试试这个
var PriorityComboCell = Backgrid.Cell.extend({
template: _.template(
'<select name="#" id="priority_select"> ' +
'<option selected="selected"></option>' +
'<option id="a">One</option>' +
'<option id="b">Two</option> ' +
'<option id="c">Three</option>' +
'</select>'
),
events: {
},
render: function () {
this.$el.html(this.template({}));
return this;
}
});