我是 ext js 的新手,现在我在列表中使用一个表
using table th and tr tags
items:
[
{
xtype: 'list',
itemTpl: '<div> <table > <tr><th> CountDown </th>
<th> Date and Time</th> </tr>
<tr> <td> {countValue}</td><td> {createdDateTime}
</td></tr></table> </div>'
}
]
现在输出是这样的表头不应该在表中重复
最佳答案
也许您正在寻找 tpl
参数而不是 itemTpl
。
itemTpl - The tpl to use for each of the items displayed in this DataView.
tpl - A String, Ext.Template, Ext.XTemplate or an Array of strings to form an Ext.XTemplate. Used in conjunction with the data and tplWriteMode configurations.
例子:
tpl: [
'<div><table>',
'<th> CountDown </th>',
'<th> Date and Time</th>',
'<tbody>',
'<tpl for=".">',
'<tr><td>{countValue}</td><td>{createdDateTime}</td></tr>',
'</tpl>',
'</tbody>',
'</table></div>'
]
It look's like in
DataView.List
tpl
can't be overrided. If you must attach something custom - you need to create new widget on your own.
也许您正在寻找 xtype grid
,查看 fiddle 上的示例:https://fiddle.sencha.com/#view/editor&fiddle/2u6g
关于javascript - EXT JS 使用列表显示使用表格的值。在表头中重复所有行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57242236/