admin管理员组文章数量:1417070
Hello I have worked with regular tables and javascript to add new rows at the end of table, could someone help me out with adding new row containing html elements at the end of table?
Hello I have worked with regular tables and javascript to add new rows at the end of table, could someone help me out with adding new row containing html elements at the end of table?
Share Improve this question asked Mar 15, 2011 at 14:21 machamacha 7,49719 gold badges65 silver badges85 bronze badges2 Answers
Reset to default 4The easiest way is with an Ext.Template
var tpl = new Ext.Template(
'<tr>',
'<td>{0}</td>',
'</tr>'
);
tpl.append('myTable', [ Ext.id() ]);
Check a working example here: http://jsfiddle/chrisramakers/xG3wq/
Updated example:
http://jsfiddle/chrisramakers/ZcQAX/
If you are dealing with a more plicated dom insert you might consider using a template created using Ext.DomHelper shown below.
var tpl = Ext.DomHelper.createTemplate({
tag: 'tr', children: [{
tag: 'td', html: '{0}'
}]
});
tpl.append('myTable', [ Ext.id() ]);
http://dev.sencha./deploy/dev/docs/?class=Ext.DomHelper
本文标签: javascriptHow to add new row to a html table in ExtJSStack Overflow
版权声明:本文标题:javascript - How to add new row to a html table in ExtJS - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745259931a2650310.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论