JQGrid datatype as Ajax function not getting called
- by mraman
Hi,
JQGrid datatype as Ajax function not getting called. once i tried to debug using firebug, found out that those lines are not exectuced. please let me know the issue with my code. Thanks in advance.
jQuery("#list").jqGrid({
//url:'example.xml',
datatype: function() {
$.ajax({
url: "example.xml",
data: "{}",
dataType: "xml",
mtype: "GET",
complete: function(jsondata, stat) { alert((jsondata.responseText));
if (stat == "success") {
alert("ew");
}
},
error : function () {alert("error")}
});
},
colNames:['QueueName','SLA Associated', 'SLA met', 'SLA Breached', 'SLA MET %', 'SLA Breached %'],
colModel :[
{name:'QueueName',index:'QueueName', width:150},
{name:'SLAAssociated',index:'SLAAssociated', width:150},
{name:'SLAmet',index:'SLAmet', width:150},
{name:'SLABreached',index:'SLABreached', width:150},
{name:'SLAMETPer',index:'SLAMETPer', width:150},
{name:'SLABreachedPer',index:'SLABreachedPer', width:150}
],
pager: jQuery('#pager1'),
rowNum:1,
rowList:[5,10],
imgpath: 'themes/basic/images'
});
in Header i add as follows
<html xmlns="http://www.w3.org/1999/xhtml">
<link rel="stylesheet" type="text/css" media="screen" href="themes/basic/grid.css" />
<link rel="stylesheet" type="text/css" media="screen" href="themes/jqModal.css" />
<link rel="stylesheet" type="text/css" media="screen" href="css/report.css" />
<script src="jquery.js" type="text/javascript"></script>
<script src="jquery.jqGrid.js" type="text/javascript"></script>
<script src="js/jqModal.js" type="text/javascript"></script>
<script src="js/jqDnR.js" type="text/javascript"></script>