0

I have the following code to select the first item in a kendoDropDownList. By changing the parameter in select from a 1 to a 2, I can select the second item. Is there a way to pass a parameter, as in 1 or 2 or 3 etc. to this line ?

ie.Document.parentWindow.execScript "$('#drgdTankCrude').data('kendoGrid').dataItem($('#Tank_ID').data('kendoDropDownList').select(1));"

I've tried the following by setting a variable called xp using double quotes, single quotes, no quotes, but nothing happens unless it's actually a number of valid items in the dropDownList.

ie.Document.parentWindow.execScript "$('#drgdTankCrude').data('kendoGrid').dataItem($('#Tank_ID').data('kendoDropDownList').select(""xp""));"
Community
  • 1
  • 1
Mitch
  • 573
  • 3
  • 13
  • 1
    `select(" & xp & ")` in VBA https://stackoverflow.com/questions/1727699/how-to-concatenate-strings-in-vba – Slai Nov 02 '17 at 16:35
  • @Slai, thank you. That does it ! Now I just need to figure out how to determine the right index number for the number I need. – Mitch Nov 02 '17 at 16:44

1 Answers1

0

Slai gave me the correct answer. The line is posted below.

Setting the xp variable, it was passed correctly

ie.Document.parentWindow.execScript "$('#drgdTankCrude').data('kendoGrid').dataItem($('#Tank_ID').data('kendoDropDownList').select(" & xp & "));"
Mitch
  • 573
  • 3
  • 13