PDA

View Full Version : How do I structure and place plugin components for Sencha Touch 2?



DeLongey
30 Apr 2012, 11:55 AM
(Also posted a StackOverflow, but then I found this forum thankfully, ref: http://stackoverflow.com/questions/10389127/how-do-i-structure-and-place-plugin-components-for-sencha-touch-2)

Just started using Sencha Touch 2 and wanted to integrate the Leaflet extension (Leaflet maps are awesome for those looking) https://github.com/VinylFox/Ext.ux.touch.Leaflet/tree/master/src.I've just started using Sencha 2, and wasn't able to find in the documentation where to drop in and reference such extensions. What's the file structure and reference code necessary to do so? Does it just go anywhere and I reference it in app.js?

I am a n00b and did not use Sencha 1 so your help is appreciated.

DeLongey
30 Apr 2012, 1:19 PM
Someone was able to shed some light on Ext.Loader and how it fits into the bigger picture. I realized it was mostly a conceptual issue for me.

Taking the Leaflet extension above, the Ext.Loader is basically the tool to load what someone might call a "plugin" in layman terms.http://www.sencha.com/blog/using-ext-loader-for-your-application/
(http://www.sencha.com/blog/using-ext-loader-for-your-application/)
So in app.jsuse Ext.Loader to load the plugin via:


Ext.Loader.setConfig({ enabled : true, paths : { 'Ext.Leaflet': './Ext.ux.touch.Leaflet/Ext.ux.touch.Leaflet.js' }});Ext.require('Ext.Leaflet');