Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
JQgrid - Ondblclick event
29/05/2012
13:22
Avatar
naysilva
New Member
Members
Forum Posts: 1
Member Since:
29/05/2012
sp_UserOfflineSmall Offline

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.

30/05/2012
11:09
Avatar
glemarie
France
Member
Members
Forum Posts: 66
Member Since:
19/12/2008
sp_UserOfflineSmall Offline

Hi,

Are you sure that the rowid's are unique in the grid ?

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information