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();
dhxWins.attachViewportTo(“vp”);
w1 = dhxWins.createWindow(“w1”, 10, 10, 300, 250);
myForm = w1.attachHTMLString(

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

);
}
doOnLoad();

w1.attachEvent(“onResizeEnd”, function(obj) {
if (obj.width() < 640) {
$(‘.form-group’).removeClass(‘col-xs-6’);
$(‘.form-group’).addClass(‘col-xs-12’);
}
});[/code]

You can see this JSFiddle with the above code if you want to try your ideas: [url]https://jsfiddle.net/davidgourde/gdkqaka6/[/url]

Thank you anyway.

Hi

you need onResizeFinish event
docs.dhtmlx.com/api__dhtmlxwindo … event.html

and not obj.width() - you need obj.getDimension()[0]
docs.dhtmlx.com/api__dhtmlxwindo … nsion.html