我是 extjs 的新手。我想为每个网格元素显示图标图像。你能帮帮我吗?
我正在从 xml 文件中获取图像路径。
我的代码如下。在这里,我正在显示图像路径。
我必须通过显示图像来替换它。
Ext.onReady(function(){
var store = new Ext.data.Store({
url: 'new_frm.xml',
reader: new Ext.data.XmlReader({
record: 'message',
fields: [{name: 'first'},{name: 'last'},{name: 'company'},{name: 'email'},{name: 'gender'},{name: 'form-file'},{name: 'state'},{name: 'Live'},{name: 'content'}]
})
});
var grid = new Ext.grid.GridPanel({
store: store,
columns: [
{header: "First Name", width: 120, dataIndex: 'first', sortable: true},
{header: "Last Name", width: 180, dataIndex: 'last', sortable: true},
{header: "Company", width: 115, dataIndex: 'company', sortable: true},
{header: "Email", width: 100, dataIndex: 'email', sortable: true},
{header: "Gender", width: 100, dataIndex: 'gender', sortable: true},
{header: "Photo", width: 100, dataIndex: 'form-file', sortable: true},
{header: "State", width: 100, dataIndex: 'state', sortable: true},
{header: "Living with", width: 100, dataIndex: 'Live', sortable: true},
{header: "Commands", width: 100, dataIndex: 'content', sortable: true}
],
renderTo:'example-grid',
height:200
});
store.load();
});