Loading ...
Sorry, an error occurred while loading the content.
 

Re: [ydn-javascript] Re: Datatable cell editor - changing options dynamically.

Expand Messages
  • Sahid Khan (সাহিদ)
    Hello, ... I think this makes sense, because options is readonly property of select element [1]. So at most you can to something like this:
    Message 1 of 4 , Oct 18, 2009
      Hello,

      On Sat, Oct 17, 2009 at 5:11 PM, Matt <matt@...> wrote:

      Thanks Sahid,

      It's worked, although for some reason not quite as you said: setting


      ed.dropdown.options = [new Option(opt1) , new Option(opt2)];

      did't work in firefox at least. However, doing

      ed.dropdown.options[0] = new Option( opt1 );
      ed.dropdown.options[1] = new Option( opt2 );

      did. Fortunately I know there will always be 2 in the dropdown initially, and I'm only replacing those 2.

      I can't really see why yours didn't work: Firebug gave me "setting a property that only has a getter" errors, but I'm sure I've done this in the past.

      I think this makes sense, because options is readonly property of select element [1]. So at most you can to something like this:

      ed.dropdown.options.length = 0;
      ed.dropdown.options[0] = new Option( opt1 );
      ed.dropdown.options[1] = new Option( opt2 );

      Sorry for making an on-the-fly reply which was not exactly correct :(

      1. http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-94282980

      HTH,
      --
      S.
      Argue with idiots, and you become an idiot. - PG
    Your message has been successfully submitted and would be delivered to recipients shortly.