Wolfie
22 Jan 2012, 12:38 PM
HI all
I am just writing my first app with Zend and ExtJs 4 and I neen urgent help please
The problem is :
I have Zend controller in wchich there are two actions : indexAction() and appAction()
I have also enabled layout for whole app. Each view is using this layout.
When I am hitting login button then I am redirecting to :
window.location = App.baseUrl + '/login/app';
where App.baseUrl - javascript object containing Zend base app path
It is redirecting me to the Zend View which looks like this :
<html lang="pl">
<head>
<!--extjs app-->
<?php echo $this->headScript()->setFile($this->baseUrl().'/js/jsapp/app.js') ?>
</head>
<body>
</body>
</html>
app.js file looks like this
Ext.Loader.setConfig({enabled:true});
Ext.require('Ext.container.Container');
Ext.application({
name: 'POB',
appFolder: 'app',
controllers: ['Orders'], <<---------
launch: function() {
Ext.create('Ext.container.Container', {
layout: 'fit',
height: '100%',
renderTo: 'content',
items: [
{
xtype: 'tabpanel',
title: 'Panel klienta',
items: [
{
//xtype: 'panel',
title: 'Zamówienia',
html: 'zamówienia bla bla bla',
items: [
]
},
{
//xtype: 'tabpanel',
title: 'Towar',
html: 'moja oferta bla bla'
},
{
//xtype: 'tabpanel',
title: 'Dane teleadresowe',
html: 'dane teleadresowe bla bla'
}
]
}
]
});
}
});
Please take a look in above script at line which is marked by arrow (<<-------)
when the line is commented everything is ok and application is launching correctly in the div="content" (renderTo: 'content')
When I unncoment this line then I got this error in chrome console
Resource interpreted as Script but transferred with MIME type text/html.
Orders.js:1Uncaught SyntaxError: Unexpected token <
I think there is no error in Orders.js file - it looks like this :
Ext.define('POB.controller.Orders', {
extend: 'Ext.app.Controller',
init: function() {
console.log('Initialized Users! This happens before the Application launch function is called');
}
});
Any ideas guys ? I'll be grateful for help
I am just writing my first app with Zend and ExtJs 4 and I neen urgent help please
The problem is :
I have Zend controller in wchich there are two actions : indexAction() and appAction()
I have also enabled layout for whole app. Each view is using this layout.
When I am hitting login button then I am redirecting to :
window.location = App.baseUrl + '/login/app';
where App.baseUrl - javascript object containing Zend base app path
It is redirecting me to the Zend View which looks like this :
<html lang="pl">
<head>
<!--extjs app-->
<?php echo $this->headScript()->setFile($this->baseUrl().'/js/jsapp/app.js') ?>
</head>
<body>
</body>
</html>
app.js file looks like this
Ext.Loader.setConfig({enabled:true});
Ext.require('Ext.container.Container');
Ext.application({
name: 'POB',
appFolder: 'app',
controllers: ['Orders'], <<---------
launch: function() {
Ext.create('Ext.container.Container', {
layout: 'fit',
height: '100%',
renderTo: 'content',
items: [
{
xtype: 'tabpanel',
title: 'Panel klienta',
items: [
{
//xtype: 'panel',
title: 'Zamówienia',
html: 'zamówienia bla bla bla',
items: [
]
},
{
//xtype: 'tabpanel',
title: 'Towar',
html: 'moja oferta bla bla'
},
{
//xtype: 'tabpanel',
title: 'Dane teleadresowe',
html: 'dane teleadresowe bla bla'
}
]
}
]
});
}
});
Please take a look in above script at line which is marked by arrow (<<-------)
when the line is commented everything is ok and application is launching correctly in the div="content" (renderTo: 'content')
When I unncoment this line then I got this error in chrome console
Resource interpreted as Script but transferred with MIME type text/html.
Orders.js:1Uncaught SyntaxError: Unexpected token <
I think there is no error in Orders.js file - it looks like this :
Ext.define('POB.controller.Orders', {
extend: 'Ext.app.Controller',
init: function() {
console.log('Initialized Users! This happens before the Application launch function is called');
}
});
Any ideas guys ? I'll be grateful for help