16 Apr 2011 4:37 AM #1
MVC App - defining non-MVC components with loader
I've started using the MVC structure for my application (fantastic btw!)
I was wondering, with this structure I have a custom proxy and store type to work with DNode (a RPC abstraction on top of Nodejs + SocketIO).
The proxy alias is defined as 'proxy.dnode' and sits in my app/data folder, as it's defined type is QM.data.DNodeProxy, however I cannot get this to load despite adding it as a require to my application.
What is the best way to implement features like this that aren't quite MVC components?
16 Apr 2011 8:41 AM #2
use the right namespace. The namespace is used to resolve the path, so your file get loaded.
So using QM.data.DNodeProxy you only have to place the DNodeProxy.js in your data folder to get loaded.
16 Apr 2011 9:57 AM #3
That's what I tried, however when I tried to invoke it by setting my proxy type to 'dnode' I get:
Cannot create an instance of unrecognized alias: proxy.dnode
The top of my define looks like this:
Ext.define 'QM.data.DNodeProxy', extend: 'Ext.data.ServerProxy' alias: 'proxy.dnode' requires: ['Ext.util.MixedCollection']
Ext.define 'QM.model.Base', extend: 'Ext.data.Model' idProperty: '_id' proxy: type: 'dnode' api: ....
16 Apr 2011 11:29 AM #4
try to add the require in your model definition, this should force the proxy to be loaded before use.
By EloB in forum Ext 2.x: User Extensions and PluginsReplies: 1Last Post: 12 May 2011, 6:02 AM
By djdixon in forum Ext 3.x: Help & DiscussionReplies: 1Last Post: 24 Nov 2010, 10:07 PM
By violinista in forum Community DiscussionReplies: 17Last Post: 10 Jun 2010, 3:05 AM