Forum


13:07

We are trying to use the jqgrid and having difficulty in using the xml format generated by the Oracle stored procedure. It is displaying the grid but without any contents.
Help !!!
HTML/JS Code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Manage Shipping Methods</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="StyleSheet" href="/apps/spm/spm_main.css" type="text/css">
<link rel="stylesheet" type="text/css" media="screen" href="/apps/spm/jquery/jqgrid/css/jquery-ui-1.7.2.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="/apps/spm/jquery/jqgrid/css/ui.jqgrid.css" />
<link rel="stylesheet" type="text/css" media="screen" href="/apps/spm/jquery/jqgrid/css/jquery.searchFilter.css" />
<script src="/apps/spm/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="/apps/spm/jquery/jqgrid/js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="/apps/spm/jquery/jqgrid/js/jquery.jqGrid.js" type="text/javascript"></script>
<script type="text/javascript">
$().ready(function ()
{
$("#list").jqGrid({
url:'spm_preq_sm_list_xml',
datatype: 'xml',
colNames:['Seq','Description', 'Entered By', 'Entered Date','Updated By','Updated Date'],
colModel:[ {name:'seq',index:'seq', width:50},
{name:'ShipMethod',index:'ShipMethod', width:100},
{name:'EnteredBy',index:'EnteredBy', width:100},
{name:'EnteredDate',index:'EnteredDate', width:80, align:"center"},
{name:'UpdatedBy',index:'UpdatedBy', width:100, align:"right"},
{name:'UpdatedDate',index:'UpdatedDate', width:80,align:"center"} ],
pager: $('#pager'),
rowNum:10,
autowidth: true,
rowList: [10,20],
viewrecords: true,
sortname: 'ShipMethod'
});
});
$("list").navGrid('#pager',{edit:false,add:false,del:false});
</script>
</head>
<body>
<h4 align="center">Manage Shipping Methods</h4>
<table id="list"></table>
<div id="pager" class="scroll"></div>
</body>
</html>
Generated XML by URL spm_preq_sm_list_xml
BODY{font:x-small 'Verdana';margin-right:1.5em} .c{cursor:hand} .b{color:red;font-family:'Courier New';font-weight:bold;text-decoration:none} .e{margin-left:1em;text-indent:-1em;margin-right:1em} .k{margin-left:1em;text-indent:-1em;margin-right:1em} .t{color:#990000} .xt{color:#990099} .ns{color:red} .dt{color:green} .m{color:blue} .tx{font-weight:bold} .db{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;border-left:1px solid #CCCCCC;font:small Courier} .di{font:small Courier} .d{color:blue} .pi{color:blue} .cb{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;font:small Courier;color:#888888} .ci{font:small Courier;color:#888888} PRE{margin:0px;display:inline}<!-- function f(e){ if (e.className=="ci"){if (e.children(0).innerText.indexOf("\\n")>0) fix(e,"cb");} if (e.className=="di"){if (e.children(0).innerText.indexOf("\\n")>0) fix(e,"db");} e.id=""; } function fix(e,cl){ e.className=cl; e.style.display="block"; j=e.parentElement.children(0); j.className="c"; k=j.children(0); k.style.visibility="visible"; k.href="#"; } function ch(e){ mark=e.children(0).children(0); if (mark.innerText=="+"){ mark.innerText="-"; for (var i=1;i<e.children.length;i++) e.children(i).style.display="block"; } else if (mark.innerText=="-"){ mark.innerText="+"; for (var i=1;i<e.children.length;i++) e.children(i).style.display="none"; }} function ch2(e){ mark=e.children(0).children(0); contents=e.children(1); if (mark.innerText=="+"){ mark.innerText="-"; if (contents.className=="db"||contents.className=="cb") contents.style.display="block"; else contents.style.display="inline"; } else if (mark.innerText=="-"){ mark.innerText="+"; contents.style.display="none"; }} function cl(){ e=window.event.srcElement; if (e.className!="c"){e=e.parentElement;if (e.className!="c"){return;}} e=e.parentElement; if (e.className=="e") ch(e); if (e.className=="k") ch2(e); } function ex(){} function h(){window.status=" ";} document.onclick=cl; -->
13:58

Moderators
08/10/2009

Alright, so jqGrid does not really depend on the database (MySql, MS SQL, Oracle, etc) so from what I can tell this is an XML formatting issue.
You can try static XML formatting until you get it right, then froce Oracle produce the type of XML jqGrid accepts.
R.
Trirand ASP.NET WebForms & MVC components based on jQuery & ThemeRoller
Most Users Ever Online: 715
Currently Online:
178 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