0
votes

I have extended a view.View to isolate just some of the events that are fired from the store (code is found at https://fiddle.sencha.com/#fiddle/1777)

The problem I am having is that when a record is added, it should fire a custom event for the controller to pick up; however, I am getting an error in the console

TypeError: owner.up is not a function

I am somewhat at an impasse at this point as I have attempted debugging the issue and the only thing I can come up with is that the error is occurring at the:

this.fireEventArgs('added',[...]);

In the globals.AltStdView class. Can someone please advise me on what I am incorrectly doing? Thanks!!

2

2 Answers

2
votes

Firstly, me.getView.dataView.store.add(record); is wrong. getView is supposed to be a method.

Secondly, added is already an event used by the framework for components. You should pick a different name.

1
votes

Couple of Issues here,

  • As @Evan mentioned, me.getView is a function. So it should be me.getView().
  • You are firing an "added" event which is actually inbuilt event of DataView and because of this listeners of added event are throwing errors as event args different. So i renamed the event to 'recordadded'

After applying the above fixes, here is the working fiddle. https://fiddle.sencha.com/#fiddle/177v