Good day all!!!
I have a girdpanel to which I'm a select listener function to from my controller. See code below:
Code:
init: function()
{
this.control(
{
'registrationWindow gridpanel[name=Member]':
{
select: this.onMemberSelect
},
});
},
onMemberSelect: function(grid, record, index, eOpts)
{
console.log('firing member select');
},
Now what I'm trying to do is add a new row
remove the select listener
select the row (should not fire select event because it has been remove)
add the select listener
This is my code, see below:
Code:
onAddMember: function(button, e)
{
this.getMemberStore().removeAll(false);
this.getMemberStore().suspendAutoSync();
this.getMemberStore().insert(0, this.getMemberModel().create());
this.getMemberStore().resumeAutoSync();
this.getMemberSearchGrid().getSelectionModel().un('select', this.onMemberSelect, this); //select listener is not being remove and console still outputs 'firing member select'
this.getMemberSearchGrid().getSelectionModel().select(0);
this.getMemberSearchGrid().getSelectionModel().on('select', this.onMemberSelect, this);
this.showMemberEditWindow(this.getMemberSearchGrid().getSelectionModel().getSelection()[0]);
},
Any help is greatly appreciated