Forum
I get this error — 'Element is not a table' — using Version 3.8.2 of jqGrid.
I have two tables on this page, both produced using my library for generating jqGrids (so all I pass are a number of parameters and the routine produces all the common code), but only one jqGrid fails this way.
I can't see the difference between these two tables, and I don't understand the error.
I have seen another thread related to this error but the answer didn't seem to relate: "TABLE" vs 'table' — if "table" is used in my code, it is generated the same for both jqGrids, but only one is failing. Has a fix to that problem been released or should I modify my version myself?
I get it whether I use IE 9 or FireFox 3.6.13
Any help on getting this fixed would be greatly apreciated
Thanks
Reg
22:55
10/08/2009
Hi Reg,
I suppose that your code generation for jqGrid has a bug where you either use <div> instead of <table> or use wrong id in the corresponding jQuery selector, so that use use jQuery(selector).jqGrid with the selector of some other elemets as the <table> which you generated. I recomend you to gebug the code with respect of Developer Tools of IE9 (F12). You should use uncompressed code of jqGrid from the "src" directory of the jqGrid download. See more information here.
Best regards
Oleg
Hi Oleg,
Thanks for your reply. In the processs of replying to you, to provide more information, I figured out the problem. I left all of my info here, in case anyone else has the same issue and can learn from my mistake. You don't need to do anything more for me on this issue.
Thanks,
Reg
IE9 debugger isn't telling me anything that I can see is helpful. There are no error messages (although I do see them when I make other mistakes, so it is not just that I am not using it correctly).
My html for the page includes two divs, one for each table:
and
When the page has loaded, I run scripts to populate these divs using ajax:
function LoadComponents() {
$.ajax({
url: "wc.dll?CMProcess~LoadContent~&OnPage=T&Target=Components&sk=35Z0UP71206456&sh=48&NoCache="+new Date().getTime(),
dataType:"html",
error: function (req,sttext) { alert(sttext+" : " +req) },
success: function(req) { $("#evalcomps").html(req) }
})
};
function LoadQuestionBank() {
$.ajax({
url: "wc.dll?CMProcess~LoadContent~&OnPage=T&Target=QuestionBank&sk=35Z0UP71206456&sh=48&NoCache="+new Date().getTime(),
dataType:"html",
error: function (req,sttext) { alert(sttext+" : " +req) },
success: function(req) { $("#questionbank").html(req) }
})
};
The first generates the error (Element is not a table) and does not display; the second works perfectly.
On the server, the called routines define the jqGrid and return html ... duh, and at this point I figured out what I was doing wrong.
The html returned by my routine for the jqGrid that did not work used the same name for the table it generates in code as the div names used on the page. A portion of my returned html looks like this:
<div align="center">
<div id="srcevalcomps"></div>
<div id="evalcompsTopMessage"></div>
<table id="evalcomps" class="jqGridTable"></table>
<div id="evalcompsPager" class="jqGridNavBar" style="text-align:right;"></div>
<div id="evalcompsMessage"></div>
</div>
<script type="text/javascript">
<!--
$("#evalcomps").jqGrid( {
url: 'wc.dll?CMProcess~AjaxGet~&Data=EvalComps&Key=&sk=35Z0UP71206456&sh=58',
Note that table id="evalcomps" matches div id="evalcomps"; once I changed this, the problem went away.
Thanks for listening,
Reg
Most Users Ever Online: 715
Currently Online:
53 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66