jqGrid Error in IE7
I am using jqgrid, it is currently working fine in FF, IE8, Chrome, Safari. But in IE7 I get this error:
'this.rows.0.cells' is null or not an object
jquery.jqGrid.min.js
Code: 0
Line: 122 Char: 278
Has anyone come accross this before? Is there a known fix?
update
Here is my PHP code:
$qry = 'SELECT stock_num, shape, carat, clarity, color, cut
FROM rapnet_diamonds
WHERE (carat BETWEEN "0" AND "5")
AND (color BETWEEN "D" AND "Z")
AND ( CASE clarity
WHEN "FL" THEN 0
WHEN "IF" THEN 1
WHEN "VVS1" THEN 2
WHEN "VVS2" THEN 3
WHEN "VS1" THEN 4
WHEN "VS2" THEN 5
WHEN "SI1" THEN 6
WHEN "SI2" THEN 7
WHEN "I1" THEN 8
WHEN "I2" THEN 9
WHEN "I3" THEN 10
ELSE -1 END BETWEEN "0" AND "10")
AND ( CASE cut
WHEN "ideal" THEN 0
开发者_JS百科 WHEN "excellent" THEN 1
WHEN "very good" THEN 2
WHEN "good" THEN 3
WHEN "fair" THEN 4
WHEN "poor" THEN 5
ELSE -1 END BETWEEN "0" AND "5")';
$grid->SelectCommand = $qry;
// set the ouput format to json
$grid->dataType = 'json';
// Let the grid create the model
$grid->setColModel();
// Set grid caption using the option caption
$grid->setGridOptions(array(
"caption"=>"Diamonds Found",
"rowNum"=>200,
"sortname"=>"diamond_id",
"hoverrows"=>true,
"sortable"=>0,
"scroll"=>1,
"height"=>300,
"altRows"=>true,
"colNames"=> array('ID', 'Shape', 'Carat', 'Clarity', 'Color', 'Cut')
));
// Change some property of the field(s)
$grid->setColProperty("diamond_id", array("label"=>"ID", "width"=>60));
// Enjoy
$grid->renderGrid('#grid','#pager',true, null, null, true,true);
$conn = null;
Here is what gets generated:
<table id='grid'></table>
<div id='pager'></div>
<script type='text/javascript'>
jQuery(document).ready(function() {jQuery('#grid').jqGrid({"width":"650","hoverrows":true,"viewrecords":true,"jsonReader":{"repeatitems":false,"subgrid":{"repeatitems":false}},"xmlReader":{"repeatitems":false,"subgrid":{"repeatitems":false}},"gridview":true,"url":"myfirstgrid.php?yellow=","editurl":"myfirstgrid.php?yellow=","cellurl":"myfirstgrid.php?yellow=","onSelectRow":function(rowid, selected)
{
if(rowid != null) {
// alert("selected: "+rowid);
loadSelectedDiamond(rowid);
}
} ,"gridComplete":function()
{
diamondsReloaded();
} ,"caption":"Diamonds Found","rowNum":200,"sortname":"diamond_id","sortable":0,"scroll":1,"height":300,"altRows":true,"colNames":["ID","Shape","Carat","Clarity","Color","Cut"],"datatype":"json","colModel":[{"name":"stock_num","index":"stock_num","editable":true,"sorttype":"string","key":true},{"name":"shape","index":"shape","editable":true,"sorttype":"string"},{"name":"carat","index":"carat","editable":true,"sorttype":"numeric"},{"name":"clarity","index":"clarity","editable":true,"sorttype":"string"},{"name":"color","index":"color","editable":true,"sorttype":"string"},{"name":"cut","index":"cut","editable":true,"sorttype":"string"}],"postData":{"oper":"grid"},"prmNames":{"page":"page","rows":"rows","sort":"sidx","order":"sord","search":"_search","nd":"nd","id":false,"filter":"filters","searchField":"searchField","searchOper":"searchOper","searchString":"searchString","oper":"oper","query":"grid","addoper":"add","editoper":"edit","deloper":"del","excel":"excel","subgrid":"subgrid","totalrows":"totalrows"},"pager":"#pager"}); });
</script>
I am using jqgrid version 3.8
After you post the link with your test solution I could examine a little the problem myself. I could see that the main page load data from the URL http://www.kranichs.com/diamond_search/myfirstgrid.php. The full get request looks like http://www.kranichs.com/diamond_search/myfirstgrid.php?yellow=&oper=grid&_search=false&nd=1283196859096&rows=200&page=1&sidx=diamond_id&sord=asc. I could also see with respect of Fiddler that the data which will be send back from the server are not correct JSON data. It seems to me that it is your main problem. The data looks like following
4cb2
{"records":"136635","page":1,"total":684,"rows":[{...}]}
0
The part {"records":"136635","page":1,"total":684,"rows":[{...}]}
are correct JSON data which jqGrid need. I tested with http://www.trirand.net/demophp.aspx and can see the same problem, but another page http://www.trirand.net/demoaspnetmvc.aspx which are more close to me has not the problem!
I recommend you to test demo pages http://www.trirand.net/demophp.aspx and http://www.trirand.net/demoaspnetmvc.aspx on the same computer where you have IE7 problem which you described.
I am only a user of jqGrid and not a developer of jqGrid, so if you found a some problem in jqGrid PHP version post it to http://www.trirand.net/. I personally bought some time ago ASP.NET MVC Subscription with the full source code to support Developers of jqGrid (but use till now only free version of jqGrid) so I have only access to ASP.NET MVC code and not to PHP version. So if your problem exist in the PHP version you have to post to the forum on http://www.trirand.net/.
精彩评论