public void Add(HtmlOptionElement option, int index) { }
Beispiel #2
0
 public static void UpdateDropdown()
 {
     HtmlSelectElement select = HtmlSelectElement.GetById("name");
     JsString selectedText = null;
     if (select.selectedIndex != -1)
     {
         selectedText = select.options[select.selectedIndex].text;
     }
     //remove all options
     foreach (HtmlOptionElement option in select.options)
     {
         select.Remove(option);
     }
     //add all options
     JsArray<JsString> cookies = Xdk.cache.GetCookieList();
     for (int i = 0; i < cookies.length; i++)
     {
         HtmlOptionElement option = new HtmlOptionElement(cookies[i], Xdk.cache.GetCookie(cookies[i]), true, true);
         select.Add(option, null);
     }
     //set selected if it is still there
     if (selectedText != null)
     {
         foreach (HtmlOptionElement option in select.options)
         {
             if (option.text == selectedText)
             {
                 option.selected = true;
                 break;
             }
         }
     }
     ShowCookie();
 }
 public void Add(HtmlOptionElement option) { }