Tuesday, July 20, 2010

Combobox setValue

In a combobox the selectionChangedEvent is called when a value is selected from the combobox and also when setValue method is used. There is always a requirement that the event should be called only when a value is selected from the list than when programmatically setting the value.

One idea i was given when going through Sencha forums is to disable all the events before setting the value and then enabling them back again (this is a little weird, as this requirement comes up most of the time. They should probably try to make it a little easier than that)..

But anyways it works for now.

  1: combobox.disableEvents(true);
  2: combobox.setValue();  //set a value
  3: combobox.enableEvents(true);

1 comment:

woodwindow937636 said...
This comment has been removed by the author.