No announcement yet.
  • Filter
  • Time
Clear All
new posts

    Add custom div to existing Canvas

    Hi All,

    I am using licensed version of SmartGWT PRO 4.1 (isc.version="v9.1p_2014-06-14/Pro Deployment";isc.versionNumber="v9.1p_2014-06-14";isc.buildDate="2014-06-14")

    Please note that we are in process to upgrade to the latest version but my question is for above version only.

    I wanted to add one of my custom div to an existing Canvas. I am doing it using below code snippet,

    addMember(new Canvas() {
                public String getInnerHTML() {
                    return "<div id=UNIQUE_DIV_ID style=\"position:absolute; width:0; height:0; z-index:-999; display: none; overflow:hidden\"/>";
    What is happening in my case is, if i am adding that as Member than it is consuming space which i do not want. If I add it as Child, than it is giving weird behavior.

    Any suggestion how can i add it as Member without actual UI getting affected ?

    Sorry, that version is too old to ask questions about. We will answer as though you asked a question about the latest version, although there are no known differences for this behavior.

    The size of the Canvas containing this HTML is determined by the sizes specified on that Canvas and its overflow settings, in just the same way as would occur for any other Canvas that did not have custom internal HTML. The only way your added content would have an impact is if the containing Canvas is overflow:visible and the content is too big for the specified size, so it overflows. That is not the case with this content, obviously.

    So as a VLayout member, with default settings, the containing Canvas would be sized at 100 height and the width of the containing Layout.

    If you make it a non-member child then it will just have its default size (100x100).

    We can't help further without knowing:

    1) what you want

    2) what is actually happening instead

    Please try to remember to include basics like this in the future. They are required.