Ext.ns('activityparameter');

activityparameter.counterInfos = Ext.extend(Ext.Panel,{
  title:"&nbsp;",
  url:'/process/EMBrowser/site/counter/process.activityparameter_counter.php'
  ,tpl:new Ext.XTemplate('<div class="type-1"><h2>{activity_parameter_name}</h2></div>')
  ,frame:false
  ,height:62
  ,bodyStyle: 'padding:2px'
  ,collapsible:true
  ,initComponent:function() {
    var config = {}; // eo config object

    // apply config
    Ext.apply(this, Ext.apply(this.initialConfig, config));
    // call parent initComponent
    activityparameter.counterInfos.superclass.initComponent.apply(this, arguments);
  } // end of function initComponent
  ,onRender:function() {
    activityparameter.counterInfos.superclass.onRender.apply(this, arguments);
  } // eo function onRender
  ,init:function(type,activityparameter_id) {
    this.activityparameter_id = activityparameter_id;
    this.type = type;
    this.load({
         url:this.url
        ,waitMsg:'Loading...'
        ,scope:this
        ,method:'GET'
        ,params:{cmd:'read',type:this.type,activityparameter_id:this.activityparameter_id}
        ,callback:function(var1,var2,response,var3) {
          var result = Ext.util.JSON.decode(response.responseText);
          switch(result.success){
            case 1:
              this.tpl.overwrite(this.body, result.data);
              this.setTitle(result.title.countertitle);
              break;
            default:
              Ext.MessageBox.alert('Attention',result.error);
            break;
          }
        }
    });
  }
});

Ext.reg('activityparametercounterinfos', activityparameter.counterInfos);

