PDA

View Full Version : Firefox: Unable to create GridPanel object



12 Jan 2010, 1:10 PM
Hello All,

I am getting a few errors while loading the grid on firefox. After some debugging I noticed that the GridPanel object is not getting instantiated. I am pasting the code here.

If someone here can please review this and direct me what I could be doing wrong, I will appreciate it. If you need any more information, please let me know.




<pre>
var selectionModel = new Ext.grid.CheckboxSelectionModel();
selectionModel.dataIndex = "DOCID";

var columnSettings = "[selectionModel, {id : 'OBSNAME', sortable : true, hidden : false, header : 'CC', dataIndex : 'OBSNAME', filterable : true, type : 'string', renderer : function(value, metaData, record, rowIndex, colIndex, store) { return '<span>' + value + '</span>'; }, align : 'left', width : 10},{id : 'NAME', sortable : true, hidden : false, header : 'Name', dataIndex : 'NAME', filterable : true, type : 'string', renderer : function(value, metaData, record, rowIndex, colIndex, store) { return '<span>' + value + '</span>'; }, align : 'left', width : 15},{id : 'DOCID', sortable : true, hidden : true, header : 'Id', dataIndex : 'DOCID', filterable : false, type : 'string', renderer : function(value, metaData, record, rowIndex, colIndex, store) { return '<span>' + value + '</span>'; }, align : 'left'}]"

var colModel = new Ext.grid.ColumnModel(eval(columnSettings));

alert("here1");
GridViewGrid = new Ext.grid.GridPanel
({
el: 'TestGridView'
,stateId: 'stateId_grid'
,stateful: true
,ds: GridViewStore
,sm: selectionModel
,cm: colModel
,renderTo: 'TestGridView'
})
alert("here2");
</pre>


I get the first alert box but not the second. I have removed many other options from the config including the plugins. This works fine on internet explorer but not on firefox. In the firefox Error Console I am getting four errors

1. Error: not well-formed
Source File: http://localhost/WS/TestList.asmx/GetListSettings?_dc=1263329165968
Line: 1, Column: 1
Source Code: { 'Columns' : [selectionModel, {id : 'OBSNAME', sortable : true, hidden : false, header : 'CC', dataIndex : 'OBSNAME', filterable : true, type : 'string', renderer : function(value, metaData, record, rowIndex, colIndex, store) { return '<span style="color: Black">' + value + '</span>'; }, align : 'left', width : 10},{id : 'NAME', sortable : true, hidden : false, header : 'Name', dataIndex : 'NAME', filterable : true, type : 'string', renderer : function(value, metaData, record, rowIndex, colIndex, store) { return '<span style="color: Brown">' + value + '</span>'; }, align : 'left', width : 15},{id : 'DOCID', sortable : true, hidden : true, header : 'Id', dataIndex : 'DOCID', filterable : false, type : 'string', renderer : function(value, metaData, record, rowIndex, colIndex, store) { return '<span style="color: Black">' + value + '</span>'; }, align : 'left'}],Fields : [{name : 'OBSNAME'},{name : 'NAME'},{name : 'DOCID'}]}

2. Error: not well-formed
Source File: http://localhost/WS/TestList.asmx/GetListXml?_dc=1263329166021
Line: 1, Column: 1
Source Code:
{'success': true, 'RowCount': 31, 'Rows': [{"OBSNAME" : "T8A","NAME" : "Gen User","DOCID" : "v123"},{"OBSNAME" : "T8A","NAME" : "Gen User","DOCID" : "v122"},{"OBSNAME" : "T8A","NAME" : "Gen User","DOCID" : "p499"},{"OBSNAME" : "T8A","NAME" : "Gen User","DOCID" : "p498"},{"OBSNAME" : "T8A","NAME" : "Gen User","DOCID" : "p497"},{"OBSNAME" : "T8A","NAME" : "Gen User","DOCID" : "p496"},{"OBSNAME" : "T8A","NAME" : "Gen User","DOCID" : "p495"},{"OBSNAME" : "T8A","NAME" : "Gen User","DOCID" : "p494"},{"OBSNAME" : "T8A","NAME" : "Gen User","DOCID" : "p493"},{"OBSNAME" : "T8A","NAME" : "Gen User","DOCID" : "p492"},{"OBSNAME" : "T8A","NAME" : "Gen User","DOCID" : "p491"},{"OBSNAME" : "T8A","NAME" : "Gen User","DOCID" : "p490"},{"OBSNAME" : "T8A","NAME" : "Gen User","DOCID" : "p489"},{"OBSNAME" : "T8A","NAME" : "Gen User","DOCID" : "p488"},{"OBSNAME" : "T8A","NAME" : "Gen User","DOCID" : "p487"},{"OBSNAME" : "T8A","NAME" : "Gen User","DOCID" : "p486"},{"OBSNAME" : "T8A","NAME" : "Gen User","DOCID" : "p485"},{"OBSNAME" : "T8A","NAME" : "Gen User","DOCID" : "p484"},{"OBSNAME" : "T8A","NAME" : "Gen User","DOCID" : "p483"},{"OBSNAME" : "T8A","NAME" : "Gen User","DOCID" : "p482"}]}

3. Error: uncaught exception: [Exception... "Node cannot be inserted at the specified point in the hierarchy" code: "3" nsresult: "0x80530003 (NS_ERROR_DOM_HIERARCHY_REQUEST_ERR)" location: "http://localhost/apps3/scripts/extjs/ext-all-debug.js Line: 15002"]

4. Error: GridViewGrid is undefined
Source File: http://localhost/apps3/scripts/GridView.js
Line: 351
This 4th error happens when I try to reference the GridPanel object later in the code.

Thanks
Salil

Jul
12 Jan 2010, 7:46 PM
It looks to me like you have unescaped double quotes in your columnSettings definition.

13 Jan 2010, 7:42 AM
Thanks Jul,
Thats not it. The unescaped double quotes was only a problem with my formatting in this post here but isn't a problem in actual code. In any case, as you suggested, I have tested it after removing that piece of code and got the same errors. I have also edited my first post to show the updates.