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 6697609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:28:49+00:00 2026-05-26T06:28:49+00:00

I am extremely new to PHP and, although I am quite familiar to javascript,

  • 0

I am extremely new to PHP and, although I am quite familiar to javascript, I am learning how to use the massive jqGrid plugin right now. I am trying to understand how jqGrid serializes the grid data and how PHP parses this data. Currently, I am not even connecting to MySQL, but I am simply trying to echo the serialized jqGrid data as “fake” results. I have the following code for js in the head of my PHP file:

<script type='text/javascript'>
   $(function(){
      $('#list').jgGrid({
         url:'grid.php',
         mtype:'POST',
         colNames:['json'],
         colModel:[{name:'j',index:'j',searchoptions:{sopt:['eq']},search:true}],
         pager:'#pager',
         rowNum:10,
         viewrecords:true,
         gridview:true,
         serializeGridData:function(postData){
            return postData;
         }
      })
   });
</script>

I then send this information to my ‘grid.php’ file, which has the following code:

<?php
   $jason = $_POST['postData'];
   $page = $jason->{'page'};
   echo '<rows>';
      echo '<page>1</page>';
      echo '<total>1</total>';
      echo '<records>1</records';
      echo '<row id="1">';
         echo '<cell>'.$page.'</cell>';
      echo '</row>';
   echo '</rows>';
?>

When I remove the serializegriddata option from the JS, everything works fine (I also add in the default $_POST[‘page’], $_POST[‘rows’], $_POST[‘sidx’], $_POST[‘sord’] back into the PHP). The problem comes in when I add the serializegriddata.

I am looking for any examples of how to use the postData on the client side (are the any other functions I need to add to the serializegriddata or can I just return the postData) and how to properly parse this in PHP (how to $_POST the data and then how to parse and use this data). I know this is probably an extremely simple solution, but everything I find just talks about the client and says nothing about the server side. Thanks in advance.

  • 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-26T06:28:50+00:00Added an answer on May 26, 2026 at 6:28 am

    Okay, I am a little slow, but I partially answered my own question. All of the jqGrid documentation read as if your entire postData was parsed as a JSON string if you set multipleSearch:true. I thought that I had to parse every variable into a postData JSON variable, then pass this to PHP. Although the solution took a little work to properly implement, the thing that I was missing was the fact that with multipleSearch:true, this adds just a ‘filter’ variable to the AJAX call. This filter variable is parsed as follows:

    $filters = $_POST['filters'];
    $json = json_decode($filters,true);
    

    and the result of $filters is:

    {"groupOp":"AND","rules":[{"field":"Customer","op":"eq","data":"eosp"}]}
    

    This is as opposed to the multipleSearch:false option of:

    $sField = $_POST['sField'];
    $sValue = $_POST['sValue'];
    $sOper = $_Post['sOper'];
    

    Once I got this, I was able to loop through all instances of my search parameters and create my $where variable. One thing that almost became a big problem for me was the old example I was able to find about properly constructing a (link below) is that you can only have WHERE is a mysql_query only 1 time.

    http://blog.brzezinka.eu/webmaster-tips/jquery/how-to-enable-the-search-functionality-in-jqgrid

    I hope this might help someone in the future (it drove me crazy for almost 2 days straight).

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

Sidebar

Related Questions

I'm extremely new to php and I am trying to get how many lines
I'm extremely new to JS and have this code that I'm trying to tweak.
I'm extremely new to PHP and my first project was developing a comment system.
I'm extremely new to SOAP and I'm trying to implement a quick test client
Extremely new to Java an just playing around with it. I'm trying to add
I am EXTREMELY new to the html/php scene but I have been working at
I'm extremely new to CSS--I'm talking I just started learning it yesterday. Anyways, I
I'm extremely new to ios. I'm trying to learn appDelegate method to pass data
I'm extremely new to using jQuery/JavaScript, so please don't judge me if this is
I am trying to create some sort of new filesystem for a PHP cache-serving

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.