0
我使用現代工具包與extjs 6.5.1。 我想在網格單元格中使用renderer屬性來使用html。渲染器只返回'<a>...</a>'
,但是當我使用它時,它將編碼html代碼,以便單元顯示'<a>...</a>'
而不是鏈接。 關於在這個線程上的答案,我將需要一個單元屬性與「encodeHtml」轉爲false,但只要我添加一個單元格屬性渲染器將不會執行了(即使當我使用EncodeHtml),並顯示像那樣的數據沒有渲染器屬性。 爲什麼不能再使用渲染器屬性?extjs渲染器未執行
繼承人我的代碼:
{
xtype: 'gridcolumn',
renderer: function(value, record, dataIndex, cell, column) {
console.log('hello world');
return '<a>...</a>';
},
width: 30,
text: '...',
cell: {
xtype: 'textcell',
encodeHtml: false
}
}
What it looks like without encodeHtml
我需要encodeHtml屬性的單元屬性,這是必需的,否則呈現器將返回純文本,在單元格中顯示' ...'而不是鏈接。當我使用Sencha架構師時,我不能將xtype更改爲gridcell。 –
我能夠通過操作代碼將xtype手動更改爲gridcell。謝謝您的幫助! –