PDA

View Full Version : How can render an extjs component into html tag element?



eliecerSR
8 Apr 2014, 6:42 AM
I need render a Extjs toolbar into div with id "myDiv" .This is my code:


var tool = Ext.create('Ext.toolbar.Toolbar', {


width : '100%',
items: [
{

text: 'Button'
},
{

text : 'Button 1'
},
{

text : 'Button 2'
},
{

text : 'Button 3'
}


]
});



Ext.define('Visor.view.modos.Modo10',
{
extend: 'Visor.view.camara.PortalPanel',
requires: ['Visor.view.camara.PortalColumn'],




title: 'Visualizador Modo 10',
autoScroll: false,
closable: true,
iconCls: 'tabs',
html:
'<table id="tabla" ><tr><td colspan="2" width="50%" height="50%"><div id="myDiv"></div></td> <td colspan="2" width="50%" height="50%"></td></tr><tr><td width="25%" height="25%"> </td><td width="25%" height="25%"></td><td width="25%" height="25%"></td><td width="25%" height="25%"></td></tr><tr><td width="25%" height="25%"></td><td width="25%" height="25%"></td><td width="25%" height="25%"></td><td width="25%" height="25%"></td></tr></table>'

});

evandropoa
8 Apr 2014, 10:16 AM
Have you read about the renderTo property of AbstractComponent?

http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.AbstractComponent-cfg-renderTo