Forum


07:53

12/11/2008

Hi,
Thanks for some great work with this plugin! Please bear with me since I'm a newbie to this. My problem is that the following code works fine in IE7 but when trying to run it in FF it gets stuck with the loading sign on...The Firebug doesn't show any errors, and the response from the php-files creating the xml seems to be ok too (i.e. the xml data seems to be ok). Any ideas??
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" type="text/css" media="screen" title="basic" href="themes/basic/grid.css" />
<link rel="stylesheet" type="text/css" media="screen" title="basic" href="themes/jqModal.css" />
<script type="text/javascript" language="javascript" src="jquery-1.2.6.js"></script>
<script type="text/javascript" language="javascript" src="jquery_from_jqGrid.js"></script>
<script type='text/javascript' language='javascript' src='jquery.jqGrid.js'></script>
<script type='text/javascript' language='javascript' src='js/jqDnR.js'></script>
<script type='text/javascript' language='javascript' src='js/jqModal.js'></script>
</head>
</body>
<table id="list19" class="scroll" cellpadding="0" cellspacing="0"></table>
<div id="myPager" class="scroll"></div>
<script type="text/javascript">
gridimgpath='themes/basic/images';
jQuery("#list19").jqGrid({
url:'getPiles.php?q=1',
datatype: "xml",
height: 600,
colNames:["Pålnummer","KranID", "Slagdatum", "Kap"],
colModel:[
{name:"Palnr",index:"Palnr", width:120, xmlmap:"Palnr"},//, editable:true, sorttype:'number'},
{name:"Kranid",index:"Kranid", width:80,xmlmap:"Kranid"},//, editable:true},
{name:"Slagningsdatum",index:"Slagningsdatum", width:130, align:"right",xmlmap:"Slagningsdatum"},//, sorttype:"date",editable:true},
{name:"Kap",index:"Kap", width:100,xmlmap:"Kap"},//sorttype:"float"}
],
xmlReader: {
root : 'rows',
row: 'Pale',
repeatitems: false,
id: '[id]'
},
rowNum:30,
rowList:[30,60,90],
imgpath: gridimgpath,
pager: jQuery('#myPager'),
sortname: 'Palnr',
viewrecords: true,
sortorder: "desc",
multiselect: false,
subGrid: true,
subGridRowExpanded: function(subgrid_id, row_id) {
// we pass two parameters
// subgrid_id is a id of the div tag created whitin a table data
// the id of this elemenet is a combination of the "sg_" + id of the row
// the row_id is the id of the row
// If we wan to pass additinal parameters to the url we can use
// a method getRowData(row_id) - which returns associative array in type name-value
// here we can easy construct the flowing
var subgrid_table_id, pager_id;
subgrid_table_id = subgrid_id+"_t";
pager_id = "p_"+subgrid_table_id;
$("#"+subgrid_id).html("<table id='"+subgrid_table_id+"' class='scroll'></table><div id='"+pager_id+"' class='scroll'></div>");
jQuery("#"+subgrid_table_id).jqGrid({
url:'getElements.php?q=2&id='+row_id,
datatype: "xml",
colNames: ['Elementtyp','Längd','Gjutdatum','Ursprung'],
colModel: [
{name:'Segmenttyp',index:'Segmenttyp',width:80,align:'left',xmlmap:'Segmenttyp'},//,editable:true, edittype:'text'},
{name:'Segmentlangd',index:'Segmentangd', width:80, align:'right', xmlmap:'Segmentlangd'},//, editable:true, edittype:'text', sortable:'false'},
{name:'Gjutdatum',index:'Gjutdatum', width:80, align:'right',xmlmap:'Gjutdatum', sorttype:'date'},//,editable:true, edittype:'text'},
{name:'Ursprung',index:'Urpsrung', width:80, align:'left',xmlmap:'Ursprung', sorttype:'date'}//,editable:true, edittype:'text'}
],
xmlReader: {
root : 'rows',
row: 'Segment',
repeatitems: false,
id: '[Segmentraknare]'
},
rowNum:5,
pager: pager_id,
caption: "Element",
imgpath: gridimgpath,
sortname: 'Segmenttyp',
sortorder: "asc",
height: '100%',
caption: "Element"
}).navGrid("#"+pager_id,{edit:false,add:false,del:false})
},
subGridRowColapsed: function(subgrid_id, row_id) {
// this function is called before removing the data
//var subgrid_table_id;
//subgrid_table_id = subgrid_id+"_t";
//jQuery("#"+subgrid_table_id).remove();
}
}).navGrid('#myPager',{add:false,edit:false,del:false});
</script>
</body>
</html>
Thanks
Gill Bates
08:56

Moderators
30/10/2007

Hello,
Maybe the problem is here
colModell:[
....
{name:"Kap",index:"Kap", width:100,xmlmap:"Kap"},//sorttype:"float"}
],
...
The comma at the last item is not valid item. Maybe this should not work
in IE6 too
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:
55 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