Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

[JS SUI] How to set click event in dropdownlist?

Contributor ,
May 31, 2016 May 31, 2016

HI.

I want to set item click event in dropdownlist.  (not onChange())

I not found that in API.

Any Ideas?

Thanks.

TOPICS
Scripting
1.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
May 31, 2016 May 31, 2016

use onClick event

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
May 31, 2016 May 31, 2016

sample script:

function main(defaultWidth) { 

  var w = new Window ("dialog", "Adjust Col._v1.0" ); 

  var tp = w.add('panel', undefined, "Choose target to apply width…" ); 

  var dd = tp.add('dropdownlist',undefined, ["Text", "Col"]); 

  var vp = w.add('panel', undefined, "Set width value…" ); 

  var ti = vp.add('edittext', undefined, defaultWidth ); 

 

  var btnGp = w.add('group'); 

  var koBtn = btnGp.add('button', undefined, "Cancel"); 

  var okBtn = btnGp.add('button', undefined, "OK"); 

 

  btnGp.orientation = "row"; 

  btnGp.alignment = "fill"; 

  btnGp.alignChildren = ["fill","right"]; 

 

  tp.alignment = "fill"; 

  dd.alignment = "fill"; 

 

  vp.alignment = "fill"; 

  ti.alignment = "fill"; 

 

  dd.selection = 0; 

 

 

  koBtn.onClick = function() { w.close(0); } 

 

  okBtn.onClick = function() { w.close(1); } 

 

  if ( w.show() == 1 ) { 

  alert( "you want to apply "+ti.text+" on "+dd.selection.text ); 

  } 

 

 

 

 

main(500); 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
May 31, 2016 May 31, 2016

Hi.

I want to set click event in "dropdownlist".

Dropdownlist can not be set onClick() event.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
May 31, 2016 May 31, 2016

dd.onActivate = function() {

     //TADAAAA

}

Loic

Ozalto | Productivity Oriented - Loïc Aigon

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 31, 2016 May 31, 2016

Un brin d'humour dans ce monde de brutes! [The French Touch!] 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jan 21, 2019 Jan 21, 2019
LATEST

Thanks!

-Sumit
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines