Forum


08:45

01/02/2010

jqQgrid isn't loading using IE7, FF or Safari. However, it loads under IE6. How unusual!
I loaded it up with Firebug and found that all the CSS files and Javascript files are being loaded. Also, there are no Javascript errors thrown. Am I missing something obvious?
<html xmlns="http://www.w3.org/1999/xhtml&q.....t;>
<head>
<meta http-equiv="Content-Type" content="text/html;.charset=iso-8859-1" />
<meta http-equiv="Content-Language" content="en-us" />
<title>My App</title>
<link href="/myapp/stylesheets/cupertino/jquery-ui-1.7.2.custom.css" media="screen" rel="stylesheet" type="text/css" />
<link href="/myapp/stylesheets/ui.jqgrid.css" media="screen" rel="stylesheet" type="text/css" />
<script src="/myapp/javascripts/jquery-1.4.min.js" type="text/javascript"></script>
<script src="/myapp/javascripts/jquery-ui-1.7.2.custom.min.js" type="text/javascript"></script>
<script src="/myapp/javascripts/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="/myapp/javascripts/jquery.jqGrid.min.js" type="text/javascript"></script>
<script type="text/javascript">
/*
*
*/
jQuery(document).ready(function(){
var mygrid = jQuery("#list").jqGrid({
loadBeforeSend: function(xhr){
xhr.setRequestHeader("Authorization", "Basic ZGV2cm9pOnBhc3N3b3Jk");
},
url:'http://myurl/my-other-app/grid.....s',
datatype: 'xml',
mtype: 'GET',
colNames:['Foo','Bar', 'Baz'],
colModel :[
{name:'foo', index:'foo', width:200, sortable:false},
{name:'bar', index:'bar', width:200, sortable:false},
{name:'baz', index:'baz', width:400, sortable:false}
],
pager: '#pager',
emptyrecords: "Nothing to display",
rowNum:500,
rowList:[100,250,500,1000],
sortname: 'foo',
sortorder: 'asc',
viewrecords: true,
caption: 'My Grid'
});
jQuery("#list").jqGrid('navGrid','#pager',{edit:false,add:false,del:false,search:false,refresh:false});
jQuery("#list").jqGrid('navButtonAdd',"#pager",{caption:"Search",title:"Search",buttonicon :'ui-icon ui-icon-search', onClickButton:function(){ mygrid[0].triggerToolbar() } });
jQuery("#list").jqGrid('navButtonAdd',"#pager",{caption:"Clear Search",title:"Clear Search",buttonicon :'ui-icon-refresh', onClickButton:function(){ mygrid[0].clearToolbar() } });
jQuery("#list").jqGrid('filterToolbar', {
autosearch: false,
beforeSearch: function() {
if(jQuery('#gs_foo').attr('value').length > 20)
{
alert("The 'Foo' search value must be 20 characters or less.");
jQuery('#gs_foo').focus();
jQuery('#gs_foo').select();
return true; // prevent the lookup
}
else
{
return false; // allow the lookup
}
}
})
});
</script>
</head>
<body>
<div id="container">
<table id="list"></table>
<div id="pager"></div>
</div>
</body>
</html>
Thanks for the help!
20:23

01/02/2010

What are the constraints around the "url" parameter?
I've found that the grid will populate with items in the modern browsers when I have the url parameter set to localhost:8080 -
Grid at location: http://localhost:8080/app1/grid
URL parameter: http://localhost:8080/app2/items
However, when I deploy to my Dev system, and I use the name of that machine, the grid no longer populates -
Grid at location: http://my.machine.net:8080/app1/grid
URL parameter: http://my.machine.net:8080/app2/items
Same machine. Same domain. Same port. No grid items..
Thanks!
20:25

01/02/2010

I should clarify and say that everything still works fine using IE6 on both systems. Meaning http://my.machine.net:8080/app2/items does return valid XML data when it receives a request.
11:50

Moderators
30/10/2007

Hello,
The url parameter is just url which is used in jQuery ajax call.
For more info refer here:
http://api.jquery.com/jQuery.ajax/
You can just thest this when you use your own ajax request to get the data.
Just try it - the result will be the same.
Best Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
73 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