Skip to content

Instantly share code, notes, and snippets.

@beginor
Created January 18, 2014 09:05
Show Gist options
  • Save beginor/8488015 to your computer and use it in GitHub Desktop.
Save beginor/8488015 to your computer and use it in GitHub Desktop.
test load extjs on demand
<!DOCTYPE html>
<html>
<head>
<title>Load ExtJS on demand</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="/ext-4/resources/css/ext-all.css" />
<script type="text/javascript" src="/ext-4/ext-debug.js"></script>
</head>
<body>
<script type="text/javascript">
Ext.onReady(function() {
Ext.Loader.setConfig({
enabled : true,
disableCaching: false,
paths : {
Ext : '/ext-4/src'
}
});
});
</script>
<button onclick="createWindow()">Create Window</button>
<script type="text/javascript">
function createWindow() {
var win = Ext.create('Ext.window.Window', {
title: 'My Window',
width: 300,
height: 200,
html: '<h1>Hello,world!</h1>'
});
win.show();
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment