Catch resize event and get width of a dhtmlx modal window

I would like to catch a dhtmlx modal window resize event and get the window’s width to add/remove CSS classes on it’s content. My goal is to get a bootstrap “responsive” layout inside a dhtmlx modal window.

I never used dhtmlx and I have a hard time understanding their documentation. I wrote the following code, and the important part is the bottom one (the event catcher). Right now, it does nothing, as I suppose I do not have the right syntax.

Would you know how I could intercept a dhtmlx modal window resize and see it’s new width, to add/remove css classes? I want to mimic bootstrap media queries, but for the modal window instead of the whole media/web page.

[code]var myForm, formData;
var dhxWins, w1;

function doOnLoad() {
dhxWins = new dhtmlXWindows();
w1 = dhxWins.createWindow(“w1”, 10, 10, 300, 250);
myForm = w1.attachHTMLString(

’ +
’ +
‘label’ +
’ +
‘’ +
’ +
’ +


w1.attachEvent(“onResizeEnd”, function(obj) {
if (obj.width() < 640) {

You can see this JSFiddle with the above code if you want to try your ideas: [url][/url]

Thank you anyway.


you need onResizeFinish event … event.html

and not obj.width() - you need obj.getDimension()[0] … nsion.html