Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Bug removing Window with custom content from parent

$
0
0
I have a Window with custom html content. When I dynamically modify that content and then remove Window from V/HLayout and draw it again - the modified content is being replaced by the original content.

Here is the example, Window has "Original Custom Content", clicking on the button above Window replaces that custom content with "New Custom Content" and makes it red, then clicking on maximize button deparents Window and draws it again at which point the new content is being replaced with original one.

Code:

isc.VLayout.create({
        ID: "layout",
        width:500,
        height: 200,
        border: 5,
        autoDraw: true,
        members:[
                isc.Button.create({
                        width: "100%",
                        height: "50",
                        title: "Click to replace Original Content in Window with New Content, then maximize <br /> New content will be replaced by Original content ",
                        click: function(){
                                var contentDiv = document.getElementById("customContent");
                                contentDiv.innerHTML = "New Custom Content";
                                contentDiv.style.color = "red";
                        }
                }),
                isc.Window.create({
                        showMaximizeButton:true,
                        showMinimizeButton:false,
                        showCloseButton:false,
                        maximize: function(){
                                this.deparent();
                                this.draw();
                                this.Super("maximize", arguments);
                        },
                        restore: function(){
                                layout.addMember(this);
                                this.Super("restore", arguments);
                        },
                        items: "<div id='customContent'>Original Custom Content</div>"
                })
        ]
});


Viewing all articles
Browse latest Browse all 4756

Trending Articles