1
BackGrid有可能構建自定義單元格格式化程序,從隱藏列組成值?Backgrid格式化程序添加其他列中的值
var grid = new Backgrid.Grid({
columns: [
{
name:"half_value_1",
cell:"string",
rendered: false
},
{
name:"half_value_2",
cell:"string",
rendered: false
},
{
name: "composite",
cell: "string",
formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function (half_value_1, half_value_2) {
return half_value_1 + '/' + half_value_2;
}
})
}],
collection: col
});
我可以得到fromRaw
函數內half_value_1
和half_value_2
?
謝謝,關鍵。我不知道我在* render *上有完整的行模型,而在* formatter *方法上沒有。這是有道理的,因爲我正在修改數據結構而不是演示文稿。 – saski
沒問題,很高興我能幫忙! :) – Key