Ext.ns('EMBrowser');

EMBrowser.CBenergyusagetype = Ext.extend(Ext.form.ComboBox,{
   //frame:true,
  store:new Ext.data.JsonStore({
    //fields:['cid', 'country'],
    fields:['usagetype_id', 'usagetype_name'],
    autoLoad: false,
    url: '/process/EMBrowser/database/energy_usagetype.php'
  })
  ,displayField:'usageype_name'
  ,valueField:'usagetype_id'
  ,mode:'local'
  ,forceSelection: true
  ,width:220
  ,triggerAction: 'all'
  ,editable: false
  ,emptyText:'Selectionnez un type d\'utilisation...'
  ,blankText:'Le champ est obligatoire'
  ,initComponent:function() {
    var config = {}; // eo config object
    Ext.apply(this, Ext.apply(this.initialConfig, config));
    EMBrowser.CBenergyusagetype.superclass.initComponent.apply(this, arguments);
  } // end of function initComponent
  ,onRender:function() {
    EMBrowser.CBenergyusagetype.superclass.onRender.apply(this, arguments);
  } // eo function onRender
  ,refresh:function(energy_id) {
    this.reset();
    this.store.load({
        waitMsg:'Loading...'
        ,params:{energy_id:energy_id}
    });
  }
});

Ext.reg('EMBrowserCBenergyusagetype', EMBrowser.CBenergyusagetype);

