Search code examples
htmlgwtlayoutcontainersgxt

How to add HTML in GXT HTML Layout Container without root element?


So my problem is, I use HTML Layout Container from GXT Sencha, and I need to add element "" but when I try it, it result with root element "". So, I want to ask, how can I add html element, without root element from GWT like "gwt-HTML class".

Thanks a lot, I need your suggest...


Solution

  • If you want to add a widget to HtmlLayoutContainer at a defined position in your HTML, you have to use HtmlData.

    HtmlLayoutContainer container = new HtmlLayoutContainer(template.getTemplate());
    container.add(row1Widget, new HtmlData("#first"));
    container.add(row2Widget, new HtmlData(".second"));
    container.add(row3Widget, new HtmlData("div:last"));
    

    Take a look at the Sencha documentation: https://docs.sencha.com/gxt/4.x/ui/layout/containers/HtmlLayoutContainer.html

    Hope that helps.