如何在此处的网格面板代码中显示“-”代替空值-
var store = Ext.getStore('someStore');
store.each(function (rec) {
if(rec.get('comment')=="") {
//what code i will write here to edit that cell with '-'
}
});
如何在此处的网格面板代码中显示“-”代替空值-
var store = Ext.getStore('someStore');
store.each(function (rec) {
if(rec.get('comment')=="") {
//what code i will write here to edit that cell with '-'
}
});
您可以尝试将列渲染器添加到网格中。
{
text: 'Comments',
dataIndex: 'comment',
renderer: function(value, metaData, record, row, col, store, gridView) {
if (record.get('comment') == "") {
return "-";
} else {
return record.get('comment');
}
}
}
查看ExtJS API 中的 Column 渲染器以获取更多详细信息。