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
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745259932a4619165.html
评论列表(0条)