Forum


13:22

29/05/2012

I am trying to use the OndblClickRow event to select the booking reference by which row is selected and no matter which row I select it always returns the first booking reference in the database. I'm not quite sure what I am doing wrong?
Here is my code:
$("#bookings").jqGrid({
url:'scripts/php/bootstrp/cp.request.php?ft=gg&table=bookings&showindex=1',
datatype: 'xml',
mtype: 'GET',
colNames:['id','Booking Reference','Date of Booking','Time of Booking','Booking Date','Return Date', 'Fare'],
colModel :[{name:'id', index:'id', hidden: true, editrules: { edithidden: true }},
{name:'bookref', index:'bookref', align:'center', search:true, width:207},
{name:'recordeddate', index:'recordeddate', align:'center', search:false, width:207},
{name:'recordedtime', index:'recordedtime', align:'center', search:false, width:207},
{name:'bookingdate', index:'bookingdate', hidden: true, editrules: { edithidden: true }},
{name:'returndate', index:'returndate', hidden: true, editrules: { edithidden: true }},
{name:'fare', index:'fare', align:'center', search:false, width:207}],
pager: $('#bookingsPager'), rowNum:500, rowList:[500,2000,5000,10000],
sortname: 'recordeddate',
sortorder: "desc",
viewrecords: true,
hidegrid: false,
imgpath: 'lib/themes/steel/images',
height: '300px',
forceFit: true,
caption: 'Bookings History',
loadtext: 'Loading',
loadui:'enable',
ondblClickRow: function(rowid)
{
var rowData = new Array();
rowData = $("#bookings").getRowData(rowid);
// rowBookingRef = rowData['bookref'];
// getGridRow(rowData)
// alert(rowBookingRef)
$("#cp-bookings-dialog").dialog({ hide: 'slide', height: 625, width: 733, title: 'Booking Reference: - '+ rowData['bookref']});
},
editurl: 'scripts/php/bootstrp/cp.request.php?ft=ug&table=bookings'
}).navGrid("#bookingsPager",{refresh:true,search:true,add:false,edit:false,del:false});
Could somebody let me know what I am doing wrong? This is giving me a massive headache.
Most Users Ever Online: 715
Currently Online:
180 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