PDA

View Full Version : [CLOSED] Set default button



michaeld
May 31, 2013, 3:02 AM
How do I set it in javascript?

Daniil
May 31, 2013, 4:07 AM
Hi @michaeld,

I think this should work.

container.defaultButton = "buttonId";

michaeld
May 31, 2013, 11:57 PM
I assume there is a way to get the control name without the "App." in an XScript reference (like #{container} adds)? Or does that matter?

Baidaly
Jun 01, 2013, 3:43 AM
Hello!

You can just set Buttons ID or one of the following samples in this example: http://examples2.ext.net/#/Buttons/Basic/Default_Button/

Daniil
Jun 03, 2013, 4:07 AM
I assume there is a way to get the control name without the "App." in an XScript reference (like #{container} adds)? Or does that matter?

A short answer is no. A long answer is yes, you can by using "#{}" and substring. Though, it doesn't matter, because this also should work.

container1.defaultButton = #{Button1};
container2.defaultButton = App.Button2;

And yes, please look at the example which @Baidaly referred.