Ext.ns('EMBrowser');

EMBrowser.CBactivitysector = Ext.extend(Ext.form.ComboBox,{
   //frame:true,
  store:new Ext.data.JsonStore({
        //fields:['cid', 'country'],
        fields:['value', 'text','group'],
        autoLoad: true,
        url: '/process/EMBrowser/database/activitysector.php'
      })
  ,initComponent:function() {
    var config = {
      displayField:'text'
      ,valueField:'value'
      ,mode:'local'
      ,forceSelection: true
      ,triggerAction: 'all'
      ,editable: false
      ,lazyRender: true
      ,emptyText:'Selectionnez un secteur d\'activité...'
      ,tpl: new Ext.XTemplate(
        '<tpl for=".">',
        '<tpl if="this.group != values.group">',
        '<tpl exec="this.group = values.group"></tpl>',
        '<div style="font: bold 12px tahoma,arial,helvetica,sans-serif;padding: 2px;border: 1px solid #fff;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">{group}</div>',
        '</tpl>',
        '<div class="x-combo-list-item">{text}</div>',
        '</tpl>'
      )
    }; // eo config object
    Ext.apply(this, Ext.apply(this.initialConfig, config));
    EMBrowser.CBactivitysector.superclass.initComponent.apply(this, arguments);

  } // end of function initComponent
  ,onRender:function() {
    EMBrowser.CBactivitysector.superclass.onRender.apply(this, arguments);
  } // eo function onRender

});

Ext.reg('EMBrowserCBactivitysector', EMBrowser.CBactivitysector);

