[英]drop down list using backgrid?
我想使用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
列。 它也不顯示下拉列表。
幫幫我,我犯了什么錯誤?
嘗試這個
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;
}
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.