setFocusOnFirstActive for JSON dhtmlxForm not working

I have a simple form…

searchForm: [ { type:"settings",position: "label-left",labelWidth:110, labelAlign:"right", inputWidth:200 }, { type:"input", name:"dwgno", id:"dwgno", label:"Drawing Number", offsetTop:10 }, { type:"input", name:"insight", id:"insight", label:"Insight Search", info:true }, { type: "block", offsetLeft:90, list:[ { type:"button", name:"searchbtn", value:"Search" }, { type:"newcolumn" }, { type:"button", name:"clearbtn", value:"Clear" } ]}, ],

When the page appears I want to put focus in the first field. Sounds simple, right? Should be, but I don’t know what I’m missing. I attached the form this way…

myForm = cx.layout.cells("a").attachForm(searchForm);

This is everything I have tried so far…

[code]/Placing this right after the .attachForm() call/
myForm.setFocusOnFirstActive();
/This way doesn’t work because of timing, need a callback so it happens AFTER the form is completely drawn/

/This won’t work for me because this way only works for loading a form from a url/
myForm.loadStruct(“link here”, function(){
myForm.setFocusOnFirstActive();
)};

/This won’t work for me because this way requires the form to be in XML format/
myForm.loadStructString(searchForm, function(){
myForm.setFocusOnFirstActive();
});[/code]

It’d be great if they just gave .attachForm() a callback function because I think the problem is that it’s trying to focus before the form is completely drawn. So how do I accomplish this with a form defined in JSON???

Thanks!

Hello
What dhtxml, OS and browser version do you have? Locally it works fine with latest build.

Which method are you saying works? Which way should I attempt it? My console shows no errors.

I’m using:
dhtmlxSuite_v36_pro_131108

OS:
Windows 7 Ultimate
6.1.7601 service Pack 1 Build 7601

Browser:
I develop using the latest version of Chrome. But I have to test in IE8 and above, Safari, Chrome, and FireFox.

You are trying to achieve focus on first action and can’t get the result, isn’t it?
Here is a demo for you - worsk fine locally (even body scrolls to the form’s input to focus it)
14.03.26.rar (76.5 KB)