Author Topic: How to get selected value of a dropdown?  (Read 1872 times)

gmswsd

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 40
    • View Profile
How to get selected value of a dropdown?
« on: May 06, 2020, 10:03:08 pm »
In the toolbar how do I get the value of the options that was selected so it can be passed as a parameter to the function.
{
type: 'select'
options: [   ["First"],
                 ["Second"],
                 ["Third"]
             ],
listener function(){
    reload( options? );
}
}

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: How to get selected value of a dropdown?
« Reply #1 on: May 06, 2020, 10:54:06 pm »
value of a select list can be obtained as $(evt.target).val()

Code: [Select]
listener: function (evt) {                                           
          //$(evt.target).val()
}

this example shows usage of select lists in the toolbar: https://paramquery.com/pro/demos/import-xlsx

gmswsd

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: How to get selected value of a dropdown?
« Reply #2 on: May 07, 2020, 05:29:40 am »
Thanks paramvir
That worked perfectly.
That and making it a single array.