attachURL to dhtmlsWindows

mysmallpic

Greetings!
I starting using your treegrid PRO widget around 2005, and eventually the whole suite V2.5 I think. Built a nice desktop application.
I’m retired now and just tinkering for fun.
I used the attachURL method with dhtmlxWindows to make an audio player in a window.
Works great.
I do not see that method in the documentation for Suite 7. I can find it in the Suite 5 documentation. How do I do this in Ver 7?
What I end up with is a grid containing a list of URL’s to mp3 files and an HTML5 audio player in a window with the javascript code to play the list.
Thinking of making something similar for my phone.

Have fun,
Paxton

The attachURL function was not brought over to DHX7. There’s a couple ways you can work around it, using attachHTML though.

One way would be to use an AJAX call to the url of your player, and then use attachHTML to attach it to the window. I’ve found this method to be easier, but I can envision cases where this may not work, depending on the complexity of the page at the url. But it’s been solid for me with static content.

var win = new dhx.Window(...);
dhx.ajax.get("/your/url").then(function(data){
    win.attachHTML(data);
});

Another would be to use attachHTML to put an iFrame into the window, and then set the source of the iFrame to your url. There’s some extra work with this one, though, because if you end up having to apply extra CSS to the iframe and dhx window if you want the iframe to fill the window and be responsive.

var win = new dhx.Window({
    ... // your other settings here
    html: "<iframe class='responsive_iframe' src='/your/url'></iframe>
});

Here’s the CSS you’ll have to add to the page to make the iframe responsive:

.dhx_window__inner-html-content { height:100%; }
.responsive_iframe { height: 100%; width: 100%; border: 0; }
1 Like

Thanks for the ideas and samples…I’ll tinker :slight_smile: