-
1 Dec 2011 9:38 AM #1
Creating Yahoo/Twitter/YouTube-like widgets from MVC app?
Creating Yahoo/Twitter/YouTube-like widgets from MVC app?
I have a full-fledged MVC app written in Ext JS 4. One of my views is a simple grid retrieving data from JSONP. My question is how can I provide this as Javascript widgets for my partners to use on their own websites? I obviously would not want to deploy my whole app to their website, but I would like to give them a single line of Javascript code that will render the grid and data coming from my central MVC app hosted on my side.. much like if I wanted to add a YouTube widget onto my website (I would only cut-and-paste a few lines of code onto my site). Any advice or experience would be greatly appreciated!
-
1 Dec 2011 10:44 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,121
- Vote Rating
- 453
Use namespacing... the name of a class dictates the folder it should be in.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
1 Dec 2011 7:47 PM #3
What if that folder is on a remote site.. can a namespace refer to a remote file?
-
2 Dec 2011 5:57 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,121
- Vote Rating
- 453
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
4 Dec 2011 9:13 AM #5
Changing the appFolder to a remote path seemed to work:
~/app.js
Then on WordPress for example, I would add an HTML widget onto my page like this:Code:Ext.application({ name: 'MyApp', appFolder: 'http://remotesite.com/app' ... });
This actually worked and rendered my DataView in the WordPress site, but does not seem so elegant. Also it makes the widget in full screen for some reason so it hides most of the WordPress site instead of being self-contained in the WordPress HTML widget. Any input or samples would be greatly appreciated.Code:<link rel="stylesheet" type="text/css" href="http://remotesite.com/lib/sencha/ext-4.0.7-gpl/resources/css/ext-all.css" /> <link rel="stylesheet" href="http://remotesite.com/css/styles.css" type="text/css" /> <script type="text/javascript" src="http://remotesite.com/lib/sencha/ext-4.0.7-gpl/ext-all-debug-w-comments.js"></script> <script type="text/javascript" src="http://remotesite.com/app.js"></script> <div id="dataview-products"></div>


Reply With Quote