如何在网格面板中显示“ - ”代替空值 代码在这里 -
var store = Ext.getStore('someStore');
store.each(function (rec) {
if(rec.get('comment')=="") {
//what code i will write here to edit that cell with '-'
}
});
答案 0 :(得分:5)
您可以尝试将列渲染器添加到网格中。
{
text: 'Comments',
dataIndex: 'comment',
renderer: function(value, metaData, record, row, col, store, gridView) {
if (record.get('comment') == "") {
return "-";
} else {
return record.get('comment');
}
}
}