问题
I was interested in knowing about extjs sandbox but wasn't able to find much about it on web. Could someone tell or point to some relevant resource as to what an extjs sandbox is and how does it work. Thanks in advance!
回答1:
An Ext JS sandbox is simply a different name on the top-level namespace.
Normally, all Ext JS code falls under the "Ext" namespace, so you would refer to classes as Ext.Element, Ext.MessageBox, etc. The sandbox (specifically, the Ext JS 4 sandbox) uses "Ext4" instead (as in Ext4.Element), so you can use multiple versions of Ext JS alongside each other without worrying about naming collisions. Sometimes they play well together, often times they do not, so you can't go adding Ext4.Elements to an Ext.Panel (at least, not without considerable effort).
The Ext JS distribution includes files listed as sandbox that you would reference in your project along with your standard files.
Check out the Sandbox example on the Ext JS docs page to see it in action. You need to use your browser's debugger to view the source and scripts, though.
来源:https://stackoverflow.com/questions/9364033/what-is-an-extjs-sandbox