I want to add Canvas element into ExtJS Container element. But it accepts only Ext.Component, not any dom element.
Canvas create code:
canvas = document.createElement('canvas');
How to insert it into container, or I need to use another ext component? I need to have some resize logic for component, container have it.
The best way to do this is to create a component where the element is the canvas. This way, you get all the built in layout stuff for "free" basically.
new Ext.container.Container({
width: 400,
height: 400,
layout: 'fit',
items: {
xtype: 'component',
autoEl: {
tag: 'canvas'
}
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With