Forum



07:11

16/02/2012

Hi all,
I'm trying to get external edit links to work in jQgrid 4.3.1, but to no avail.
I've followed the example at http://trirand.com/blog/jqgrid.....nbsp;under Row Editing -> Custom Edit,
however I am unable to get the actual link to appear. I get the column, but it is empty.
The data grid itself displays correctly.
My troubleshooting has led me to believe that the problem is relating to using XML data. All of the examples
I have seen use Local or JSON data.
I've noticed that if I were to change my code from XML to Local, it works perfectly fine
(although local is not an option - being a database driven site)...
Any assistance appreciated.
Edit: Sorry guys, this has to be the worst wysiwtf editor I've ever seen... it's just not displaying right for me.
My HTML code is: (This is a completely stripped down test page)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<title>Test Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script src="js/jquery-1.6.2.min.js"></script>
<link rel="stylesheet" href="js/jquery.jqGrid-4.3.1/css/ui.jqgrid.css">
<link rel="stylesheet" href="js/jquery.jqGrid-4.3.1/css/jquery-ui-1.8.17.custom.css">
<script src="js/jquery.jqGrid-4.3.1/js/i18n/grid.locale-en.js"></script>
<script src="js/jquery.jqGrid-4.3.1/js/jquery.jqGrid.min.js"></script>
</head><body>
<table id="otherContacts"><tr><td/></tr></table>
<div></div></fieldset><script>
$("#otherContacts").jqGrid({
url:'sql2xml.php?query=grid&type=coreSite&source=coreContact&limiter=parentid,1',
datatype: "xml",
mtype: 'GET',
colNames:['ID','Salutation','First Name','Last Name', 'Title','Edit'],
colModel:[{name:'id',index:'id',width:10},
{name:'salutation',index:'salutation',width:50},
{name:'firstname',index:'firstname',width:90},
{name:'lastname',index:'lastname',width:90},
{name:'title',index:'title',width:90},
{name:'edit',index:'edit',width:20}],
width: 600,
height: 100,
pager: '#otherContacts_container',
rowNum:10,
rowList:[10,25,50],
sortname: 'id',
sortorder: 'desc',
viewrecords: true,
gridview: true,
scrollOffset: 0,gridComplete: function(){
var ids = $("#otherContacts").jqGrid('getDataIDs');
for(var i=0;i < ids.length;i++){
var cl = ids[i];
be = "<a href="#" onclick="window.location.href='editItem.php?id="+cl+"'">Edit</a>";
$('#otherContacts').jqGrid('setRowData',ids[i],{edit:be});
}
}
});
$('#otherContacts').jqGrid('hideCol', ['id']);
$('#otherContacts').jqGrid('navGrid',"#otherContacts_container",{edit:false,add:false,del:false});
</script></body>
</html>
Most Users Ever Online: 715
Currently Online:
56 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