Skip to Content
0
Oct 19, 2019 at 02:57 AM

this.getOwnerComponent().getModel(") is not a function issue

1279 Views

Hi,

Below is my code in a .js file which is part of my util folder. Here I am extending a standard control. But when I try to get access to the global model declared in component.js file, console says that.getOwnerComponent().getModel("GlobalStore") is not a function. What is that I am doing wrong ? I tried with 'this' as well but no luck.

onAfterRendering: function(){

var that = this;

this.addDelegate({
onclick(event)
  {
if (that.getOwnerComponent().getModel("GlobalStore").getData() == undefined)
{
//some code
}

}
});
},