In updating code for my team's widget, I came across this chunk of code. It was done on 0.2.2, and was used to switch views into our main section, as well as performing a new XHR send which updates the information in that main section's view.
After updating it to 1.1, I've discovered that I can't call that getDataFeed function in this way.
Is there a way to call a function that is outside of the view (and file) of the one that's calling it? Will I need to have that view already loaded at least once for it to work?
Just to specify, we're looking for a way to access an array of views in the widget, in order to call a datafeed function while it's view is loading.
One view should never ever be calling methods on another view like that. If you want to have a common function of this nature available from several different views, then you should make a stand alone library. A good pattern to follow is available in many of the stock widgets. Feel free to ping me if you need more examples.