Skip to content
Advertisement

extjs combo box getCount() on store returns 0

I am trying to get the number of items in the combo box so that I can make the first value by default visible in the combo box using the getCount() method but I see it always return 0 so cannot get the first item to be displayed in the combo box.

Code for my combo box is as shown below:

JavaScript

Code for the store is as below:

JavaScript

The result returned from the api to populate the store is as follows:

JavaScript

Any suggestions on what’s missing would be great!

Advertisement

Answer

I am written that example for you in Sencha Fiddle: https://fiddle.sencha.com/#view/editor&fiddle/3cdl

That solve your problem:

JavaScript
Advertisement