Mittwoch, 6. Februar 2013

Raw HTML in CQ5

I had to solve a problem of publishing some custom HTML code usning CQ5 with Ext JS. Raw HTML can be passed to DOM using CQ.form.OwnerDraw
var rawComponent = new CQ.form.OwnerDraw({ html: '<div>I am raw</div>' });
To alter this generated code, you may use a wrapping container like
var wrapper = new CQ.Ext.Panel();
and pass the raw component to it.
wrapper.removeAll(); // clear parent wrapper.add(rawComponent); wrapper.doLayout(); // force redraw

Keine Kommentare:

Kommentar veröffentlichen