-
25 Jul 2012 11:51 AM #1
Answered: Extjs 4 not working on Chrome and working on IE
Answered: Extjs 4 not working on Chrome and working on IE
Hi Team,
Please help me out. I am trying to make a small application. I have included ext-all-dev.js and ext-dev.js in my html file, and then I am rendering Form as well as Grid in a separate JS which is included in html file. When I use this html page in IE, It shows me Form, but not Grid. But both of them are not working in Chrome.
Previously when I was adding bootstrap.js in my project, chrome was loading form.. Also, let me know which and all JS files should I include from ExtJS directory.
Please help.
Thanks.Last edited by jenis35@yahoo.co.in; 25 Jul 2012 at 11:53 AM. Reason: missed some part
-
Best Answer Posted by scottmartin
Here would be the code version:
Make sure to change your path as needed.
index.html
example.jsCode:<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>f232712</title> <link rel="stylesheet" type="text/css" href="../extjs4/resources/css/ext-all.css"/> <link rel="stylesheet" type="text/css" href="../extjs4/examples/shared/example.css" /> <script type="text/javascript" src="../extjs4/ext-all-debug.js"></script> <script type="text/javascript"> document.write('ExtJS: '+Ext.versions.extjs.version); </script> <!-- page specific --> <script type="text/javascript" src="example.js"></script> </head> <body> <h1>f232712</h1> </body> </html>
Scott.Code:Ext.create('Ext.grid.Panel', { store: Ext.create('Ext.data.ArrayStore', { fields: [ { name: 'book'}, { name: 'author'} ], data: [['Ext JS 4: First Look', 'Loiane Groner']] }), columns: [{ text: 'Book', flex: 1, sortable: false, dataIndex: 'book' }, { text: 'Author', width: 100, sortable: true, dataIndex: 'author' }], height: 80, width: 300, title: 'Simple Grid', renderTo: Ext.getBody() });
-
25 Jul 2012 12:28 PM #2Sencha - Support Team
- Join Date
- Jul 2010
- Location
- Houston, Tx
- Posts
- 7,185
- Vote Rating
- 194
- Answers
- 433
You should only need ext-all-dev (or ext-all-debug) for development, not ext-dev as well.
If you take one of our examples does it run?
Do you see any errors on the console?
What are you using to debug your application?
Here is an example html (very basic)
Scott.Code:<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Title</title> <link rel="stylesheet" type="text/css" href="../extjs4/resources/css/ext-all.css"/> <!-- pick one based on needs --> <!-- ext.js, ext-all-debug.js, ext-all-dev.js --> <script type="text/javascript" src="../extjs4/ext-all-debug.js"></script> <!-- page specific --> <script type="text/javascript" src="app.js"></script> </head> <body> <h1>Body</h1> </body> </html>
-
25 Jul 2012 12:58 PM #3
Hi Scott,
Thanks for the reply. I have now only included ext-all-dev.js in my project, I am able to load the form, but somehow the Grid is not loading. It is showing me this error in the console.
ext-all-dev.js:71019Uncaught TypeError: Cannot read property 'items' of undefined
Here is my Grid panel (gridsample.js) code.
Here is how my html looks like:Code:Ext.create('Ext.grid.Panel', { store : Ext.create('Ext.data.ArrayStore', { fields : [{ name : 'book' }, { name : 'author' }], data : [['Ext JS 4: First Look', 'Loiane Groner']] }), columns : [{ text : 'Book', flex : 1, sortable : false, dataIndex : 'book' }, { text : 'Author', width : 100, sortable : true, dataIndex : 'author' }], height : 80, width : 300, title : 'Simple Grid', renderTo : Ext.getBody() });
Please tell me where am I doing mistake ?Code:<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ page session="false"%> <c:set var="ctx" value="${pageContext.request.contextPath}" /> <html> <head> <title>Teacher Certification POC</title> <link href="<c:url value="/resources/lib/ext-4.1.0/resources/css/ext-all.css" />" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="<c:url value="/resources/lib/ext-4.1.0/ext-all-dev.js" />" ></script> <script type="text/javascript" src="<c:url value="/resources/js/gridsample.js" />"></script> </head> <body> <h2>Welcome User !!</h2> </body> </html>
-
25 Jul 2012 1:07 PM #4
Hi Scott, <br>
<br>
Thanks for the reply. I have now only included ext-all-dev.js in my project, I am able to load the form, but somehow the Grid is not loading. It is showing me this error in the console. <br>
<br>
<a href="http://localhost:8080/SampleProject-0.0.1-SNAPSHOT/resources/lib/ext-4.1.0/ext-all-dev.js" target="_blank" rel="nofollow">ext-all-dev.js:71019</a><font color="#FF0000"><span style="font-family: Consolas">Uncaught TypeError: Cannot read property 'items' of undefined<br>
<br>
<br>
<br>
</span></font><span style="font-family: Consolas">Here is my Grid panel (gridsample.js) code. <br>
<br>
<br>Code:<br> Ext.create('Ext.grid.Panel', {<br> store : Ext.create('Ext.data.ArrayStore', {<br> fields : [{<br> name : 'book'<br> }, {<br> name : 'author'<br> }],<br> data : [['Ext JS 4: First Look', 'Loiane Groner']]<br> }),<br> columns : [{<br> text : 'Book',<br> flex : 1,<br> sortable : false,<br> dataIndex : 'book'<br> }, {<br> text : 'Author',<br> width : 100,<br> sortable : true,<br> dataIndex : 'author'<br> }],<br> height : 80,<br> width : 300,<br> title : 'Simple Grid',<br> renderTo : Ext.getBody()<br> });<br> <br> <br>
<br>
Here is how my html looks like:<br>
<br>
<br>Code:<br> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%><br> <%@ page session="false"%><br> <c:set var="ctx" value="${pageContext.request.contextPath}" /><br> <html><br> <head><br> <title>Teacher Certification POC</title><br> <br> <br> <br> <br> <br> <br> <link href="<c:url value="/resources/lib/ext-4.1.0/resources/css/ext-all.css" />" rel="stylesheet" type="text/css" /><br> <br> <br> <br> <br> <script type="text/javascript" src="<c:url value="/resources/lib/ext-4.1.0/ext-all-dev.js" />" ></script><br> <br> <br> <script type="text/javascript" src="<c:url value="/resources/js/gridsample.js" />"></script><br> <br> <br> <br> <br> <br> <br> </head><br> <body><br> <h2>Welcome User !!</h2><br> </body><br> </html><br> <br> <br>
<br>
Please tell me where am I doing mistake ?</span>
-
25 Jul 2012 4:55 PM #5Sencha - Support Team
- Join Date
- Jul 2010
- Location
- Houston, Tx
- Posts
- 7,185
- Vote Rating
- 194
- Answers
- 433
-
25 Jul 2012 4:57 PM #6Sencha - Support Team
- Join Date
- Jul 2010
- Location
- Houston, Tx
- Posts
- 7,185
- Vote Rating
- 194
- Answers
- 433
Here would be the code version:
Make sure to change your path as needed.
index.html
example.jsCode:<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>f232712</title> <link rel="stylesheet" type="text/css" href="../extjs4/resources/css/ext-all.css"/> <link rel="stylesheet" type="text/css" href="../extjs4/examples/shared/example.css" /> <script type="text/javascript" src="../extjs4/ext-all-debug.js"></script> <script type="text/javascript"> document.write('ExtJS: '+Ext.versions.extjs.version); </script> <!-- page specific --> <script type="text/javascript" src="example.js"></script> </head> <body> <h1>f232712</h1> </body> </html>
Scott.Code:Ext.create('Ext.grid.Panel', { store: Ext.create('Ext.data.ArrayStore', { fields: [ { name: 'book'}, { name: 'author'} ], data: [['Ext JS 4: First Look', 'Loiane Groner']] }), columns: [{ text: 'Book', flex: 1, sortable: false, dataIndex: 'book' }, { text: 'Author', width: 100, sortable: true, dataIndex: 'author' }], height: 80, width: 300, title: 'Simple Grid', renderTo: Ext.getBody() });Last edited by scottmartin; 25 Jul 2012 at 4:57 PM. Reason: Updated code
-
30 Jul 2012 10:16 AM #7


Reply With Quote