Forum


23:19

28/12/2009

I am not getting any error messages in IE7 and it works fine on Firefox. I am using the demo files that are free to download on this site just for testing purposes. I do not have a web server this is all local data, I do not plan on using a web server.
The files that I am using are xmlmap.js, xmlmap.html, book.xml from the example with slight modifications. The grid loads but not the xml data nor the row numbers. I have attached a screen shot of what it looks like in IE7 VS FF http://tinypic.com/r/18n5au/7 is the url for the pic, if this can't display it properly. Thank you very much for the help. I did search the forums for similar problems and have tried different things including checking my javascript for extra commas but I can't find anything. I tried firebug, there are no errors what so ever.
I am using the latest version of the grid.
HTML
<html xmlns="http://www.w3.org/1999/xhtml&q.....t;>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Inventory</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" media="screen" href="css/sunny/jquery-ui-1.8.7.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="css/ui.jqgrid.css" />
<script src="js/jquery-1.4.4.min.js" type="text/javascript"></script>
<script src="js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script src="js/jquery-ui-1.8.7.custom.min.js" type="text/javascript"></script>
</HEAD>
<body>
<table id="list19" class="scroll" cellpadding="0" cellspacing="0"></table>
<script src="xmlmap.js" type="text/javascript"></script>
</body>
</HTML>
JAVASCRIPT > xmlmap.js
function() {
var gridimgpath = 'css/sunny/images';
$("#list19").jqGrid({
url: 'inventory.xml',
datatype: "xml",
colNames:["On Hand", "Product Name", "Product Code", "Deficit"],
colModel:[
{name:"On Hand",index:"onHand", width:50, xmlmap:"ItemAttributes>onHand", sorttype:"int"},
{name:"Product Name", index:"productName", width:310, align:"left", xmlmap:"ItemAttributes>productName"},
{name:"Product Code", index:"productCode", width:160, align:"left", xmlmap:"ItemAttributes>productCode"},
{name:"Defecit", index:"onHand", width:60, align:"right", xmlmap:"ItemAttributes>onHand", formatter:highlight}
],
height:250,
//rowNum:20,
//rowList:[10,20,30],
imgpath: gridimgpath,
viewrecords: true,
loadonce: true,
rownumbers: true,
rownumWidth: 40,
xmlReader: {
root : "Items",
row: "Item",
repeatitems: false,
id: "onHand"
},
caption: "Inventory" + " | " + "Last Inventory Date = 1/3/2011"
});
function highlight (cellValue, options, rowObject) {
var color = (parseInt(cellValue-10) < 0) ? "red" : "green";
if(parseInt(cellValue-10) > 0) {
var cellHtml = "<span style='color:" + color + "' originalValue='" +(cellValue-10) + "'>" + (cellValue-10) + " Extra" + "</span>";
return cellHtml;
}
else {
var cellHtml = "<span style='color:" + color + "' originalValue='" +(cellValue-10) + "'>" + (cellValue-10) + " Missing" + "</span>";
return cellHtml;
}
}
});
XML > inventory.xml I had to shorten the xml just for testing in case there was something wrong with the data but it doesn't appear to be.
<?xml version="1.0" encoding="UTF-8"?>
<Inventory>
<Items>
<Request>
<IsValid>True</IsValid>
<ItemSearchRequest>
<SearchIndex>Inventory</SearchIndex>
</ItemSearchRequest>
</Request>
<Item>
<DetailPageURL></DetailPageURL>
<ItemAttributes>
<onHand>9</onHand>
<productName>Lenovo Thinkcentre Desktop Computers</productName>
<productCode>7268D1U</productCode>
</ItemAttributes>
</Item>
</Items>
</Inventory>
Most Users Ever Online: 715
Currently Online:
52 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