window.attachURL is gone

I would dearly love to know how to get this working, as I’ve built an entire framework around using this.

attachHTML isn’t cutting it, and there’s virtually no documentation for attach()

Thanks in advance.
Doug

1 Like

You may attach an iframe to your cell with the attachHTML() and use it similar to the attachURL().

attach() method can be used to attach dhtmlx components to your cell.
Here you can find a tutorial:
https://docs.dhtmlx.com/suite/layout__work_with_layout.html#attachingacomponenttoacell
and a usage example:
https://docs.dhtmlx.com/suite/samples/layout/03_usage/01_attach.html

This is very disappointing being a customer - our whole application depends on adding content to layout cell on attachURL method. dhtmlx6.0 definately is a downgrade from the previous version. we will definitely be moving away from dhtmlx as features are deprecated without regard to all the customers.

3 Likes

I originally thought ajax could be used to fetch the html and then load into the window using:

dhxWindow.attachHTML(html);

this works but but the problem is that no scripts are loaded so I think there is no option but to use an iframe. It is simple to do but showing progress while the frame loads it’s content is not so easy, I came up with this which seems to work ok:

//Show loading image here

$.ajax({
url: "mypage.php",
type:'POST',
data: {somearg:"a"},
success:function(ret){
    
    //Hide loading image here

    var htmlContent = "<iframe id='frMain' src='' onload='frameLoaded()'></iframe>";
    
    frameLoaded = function() {
        var frame = document.getElementById('frMain');
        if (!frame.srcdoc)
            frame.srcdoc = ret;
    }
    
    new dhxWindow.Window({html: htmlContent});        
    dhxWindow.show();
}                

});

If using the iFrame method, what is the best way to get a reference to this frame from the main page?
(It appears that .getFrame() does not exist in v6)

You may try to use the standalone solutions allowing to get the iframe content.

We are in the boat I also feel that way.
But we are sticking on v5.2

in the suite 5 there is an attachUTL method allowing to control the attached iframe using the dhtmlx API:
https://docs.dhtmlx.com/windows__attach_urls.html#accessingparentfromattachedpage
https://docs.dhtmlx.com/windows__attach_urls.html#usingoncontentloadedevent