Ext.onReady(function(){

    Ext.namespace('Tine');

    Ext.Ajax.on('beforerequest', function(connection, options){
        options.url = '/tinedemo_client/getcontrylist.php';
    }, this);
    
    var countryCombo = new Tine.widgets.CountryCombo({
        fieldLabel: 'Country',
        name: 'country'
    });
    countryCombo.on('select', function(combo, record){
        Ext.example.msg('Counry Selected', 'You selected "{0}" which has the iso code "{1}".', record.data.translatedName, record.data.shortName);
    }, this);
    
    // force data load
    countryCombo.getCountryStore().load();
    var simple = new Ext.FormPanel({
        labelWidth: 75, // label settings here cascade unless overridden
        frame:true,
        title: 'Select Country Sample',
        bodyStyle:'padding:5px 5px 0',
        width: 350,
        defaults: {width: 230},
        defaultType: 'textfield',

        items: countryCombo
});
   
    simple.render(document.body);
});


