In my project, I have defined a Ext.grid.Panel
named JobList
, which includes an Ext button with the unique identifier myButton
. The JobList
also has its own controller. Within the controller, I have incorporated the following code:
Ext.define('App.controller.JobList', {
extend: 'Ext.app.Controller',
refs: [
{ref: 'jobList', selector: '#jobList'},
{ref: 'myButton', selector: '#myButton'}
],
init: function(){
this.control({
'jobList': {
select: this.selectJob
}
});
},
selectJob: function(){
this.getMyButton().enable();
}
});
Now, when I instantiate two instances of JobList
using Ext.create
and assign them the IDs jobList1
and jobList2
, a problem arises. When I select a job on jobList2
, it ends up enabling the myButton
on jobList1
instead of on jobList2
. How can I ensure that each instance of JobList
correctly enables its own myButton
?