Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7588059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:49:47+00:00 2026-05-30T19:49:47+00:00

I’m quite new to php and jquery so any help would be much appreciated.

  • 0

I’m quite new to php and jquery so any help would be much appreciated. I basically have a grid called ‘booking’ which displays all the information about bookings stored in a database.

enter image description here

When you double click a row it brings up a Jquery Dialog Box that displays all the information about their booking:

enter image description here

At the moment, no matter which booking you click on it always displays the information from the first row of the database. What I want is for it to display the data from the database by which row is selected.

This is the PHP code:

        $pdo = new SQL();
        $dbh = $pdo->connect(Database::$serverIP, Database::$serverPort, Database::$dbName, Database::$user, Database::$pass);

        try {

            $query = "SELECT * FROM tblbookings";


            $stmt = $dbh->prepare($query);

            $stmt->execute();

            $row = $stmt->fetch(PDO::FETCH_BOTH);

 /*           Company::set_id($row['Id']);
            Company::set_name($row['CompName']); */
            BookingDocket::set_id($row['id']);
            BookingDocket::set_bookref($row['bookref']);
            BookingDocket::set_returndate($row['returndate']);


            $stmt->closeCursor();

        }

        catch (PDOException $pe) {
            die("Error: " .$pe->getMessage(). " Query: ".$stmt->queryString);
        }

        $dbh = null;

    }

JQGrid Code:

$("#bookings").jqGrid({
    url:'scripts/php/bootstrp/cp.request.php?ft=gg&table=bookings&showindex=0',
    datatype: 'xml',
    mtype: 'GET',
    colNames:['id', 'Booking Reference','Date of Booking','Time of Booking','Fare'],
    colModel :[{name:'id', index:'id', hidden:'true', align:'center', search:false, width:'210px'},
    {name:'bookref', index:'bookref', align:'center', search:true, width:'210px'},
        {name:'recordeddate', index:'recordeddate', align:'center', search:false, width:'210px'},
        {name:'recordedtime', index:'recordedtime', align:'center', search:false, width:'210px'},
        {name:'fare', index:'fare', align:'center', search:false, width:'210px'}],
    pager: $('#bookingsPager'), rowNum:500, rowList:[500,2000,5000,10000],
    sortname: 'recordeddate',
    sortorder: "desc",
    viewrecords: true,
hidegrid: false,
rowNum: 500,
    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);
    $("#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});

$("#bookings").setGridWidth('710px',false);

Any help would be great!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T19:49:49+00:00Added an answer on May 30, 2026 at 7:49 pm

    I think that it would be much more easy to include all booking information in the grid as hidden columns and to use viewGridRow method to display detailed information. To make the hidden columns be visible in the View-form you need add editrules: { edithidden: true } setting in the column definition.

    I made the demo for you which uses

    ondblClickRow: function (id) {
        $(this).jqGrid('viewGridRow', id, { caption: "Booking Reference" });
    }
    

    As the result the grid with a few columns

    enter image description here

    will display the detailed information after the double-click or after selection a row and clicking on the “View” navigator button:

    enter image description here

    I think it would be the easiest way to implement your requirements.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I would like to count the length of a string with PHP. The string
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
Basically, what I'm trying to create is a page of div tags, each has
I am reading a book about Javascript and jQuery and using one of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.