Add option as object to Combo

I have object:

items = [ {value:'value1', text: 'text1'}, {value:'value2', text: 'text2'}, {value:'value3', text: 'text3'} ];
This object will be changed. So I want add options like this:

z.addOption([ items ]);
Of course, it doesn’t work.

How can I add options using only object?


You were almost right. The only thing you need to correct is to pass items array directly into method (without addition array):


instead of

z.addOption([ items ]);

Yes. Thanks!