javascript - How to add new row to a html table in ExtJS - Stack Overflow

Hello I have worked with regular tables and javascript to add new rows at the end of table, could someo

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 badges
Add a ment  | 

2 Answers 2

Reset to default 4

The 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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745259932a4619165.html

相关推荐

  • javascript - How to add new row to a html table in ExtJS - Stack Overflow

    Hello I have worked with regular tables and javascript to add new rows at the end of table, could someo

    4小时前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信