Continents list is loaded in declaration Show code
$('.continent-input').easySelect({ idKey: 'value', textKey: 'name', items: [ { name: 'Africa', value: 1}, { name: 'Antarctica', value: 2}, { name: 'Asia', value: 3}, { name: 'Australia', value: 4}, { name: 'Europe', value: 5}, { name: 'North America', value: 6}, { name: 'South America', value: 7} ] });
States list is loaded asynchronously Show code
$('.state-input').easySelect({ idKey: 'id', textKey: 'text' }); $.get('data/states.json').done(function(items) { // Each item looks like { id:'KS', text: 'Kansas' } $('.state-input').data('easySelect').setItems(items); });