PDA

View Full Version : how to assign values to panel before initComponent



rushi2440
1 Aug 2012, 1:45 AM
Hi.. forum member
I am having some problem in assigning the panel values from the controller. Below is my panel view

Ext.define('admin.view.projectmgt.taskPanel', {
extend: "Ext.form.Panel",
id: 'taskpanel',
alias: 'widget.taskpanel',
requires: [],
weekendfirstDay:null,
weekendsecondDay:null,

initComponent: function() {
var me = this;
console.time('foo');
me.on({
scope: me,
beforerender: me.onBeforeRendere
});

console.log('init compo weekendfirstDay ::'+this.weekendfirstDay);
console.log('init compo weekendsecondDay ::'+this.weekendsecondDay);



me.callParent(arguments);
console.timeEnd('foo');
},

onBeforeRendere: function() {
console.log('BEFOR SHOW ::'+this.weekendfirstDay);
console.log('BEFOR SHOW ::'+this.weekendsecondDay);

}


});


and my controller from where I am setting the values for weekendfirstDay and weekendsecondDay is below

var panel = this.getTaskPanel();
panel.weekendfirstDay = 1;
panel.weekendsecondDay = 3;


I am not able to get the values assigned to Panel in the initComponent function, but I am getting the values in the onBeforeRendere.

So please suggest me some way I can set the values from my controller to my Panel view and use them to my initComponent function.