PDA

View Full Version : Hello Ext application shows nothing



moha.fazel
13 Mar 2014, 4:47 AM
I am new in ext js and I am creating the first application in tutorial of Ext JS 4.2.0 (http://docs.sencha.com/extjs/4.2.0/)
as mentioned in it I have created index.html with the following codes:


<html><head>
<title>Hello Ext!</title>

<link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css">
<script type="text/javascript" src="extjs/ext-debug.js"></script>
<script type="text/javascript" src="app.js"></script>
</head>
<body></body>
</html>

and app.js with the following contents:


Ext.application({ name: 'HelloExt',
launch: function () {
Ext.create('Ext.container.Viewport', {
layout: 'fit',
items: [
{
title: 'Hello Ext!'
html : 'Hello! Welcome to Ext JS.'
}
]
});
}
});

But it shows me only the title of the page Hello Ext!. also if I debug it using Chrome developer tools. it shows me this error: Uncaught SyntaxError: Unexpected identifier in app.js:9 exactly where html tag have been used.

mitchellsimoens
13 Mar 2014, 5:26 AM
You're missing a comma after the title config.


Ext.application({ name: 'HelloExt',
launch: function () {
Ext.create('Ext.container.Viewport', {
layout: 'fit',
items: [
{
title: 'Hello Ext!', //<-- comma added here
html : 'Hello! Welcome to Ext JS.'
}
]
});
}
});