Forum

July 10th, 2011
You must be logged in to post Login Register

Search Forums:


 






jQgrid fails when I use server side sorting

UserPost

02:39
06/07/2012


dancombs

North Brookfield, MA

Member

posts 3

Post edited 16:46 – 06/07/2012 by dancombs


I have a select input that chooses and populates a jQgrid (#1). When a row is selected on this jQgrid (#1), a second jQgrid (#2) is populated. This is where the problem comes in. Here is the rowselect:


    onSelectRow: function(id){
        if(id == null)
        {
             id=0;
             if($("#ship").jqGrid('getGridParam','records') >0 )
             {
                  $("#ship").jqGrid('setGridParam',{url:"ship.php?uic="+id});
                 $("#ship").jqGrid('setCaption',"That UIC: "+id).trigger('reloadGrid');
             }
        }
        else
        {
            $("#ship").jqGrid('setGridParam',{url:"ship.php?uic="+id});
            $("#ship").jqGrid('setCaption',"This UIC: "+id).trigger('reloadGrid');

The file ship.php takes a 6 digit uic code and processes it via:

$uic = $_GET['uic'];

If I use this select statement in ship.php:

$query_rsShip = "SELECT UIC, Command_Name, Hull_Number FROM command ORDER BY $sidx $sord LIMIT $start , $limit";

it passes all the rows of data to jQgrid (#ship). If I put a where clause on my select statement like so:

$query_rsShip = "SELECT UIC, Command_Name, Hull_Number FROM command WHERE UIC = ".$uic." ORDER BY $sidx $sord LIMIT $start , $limit";

No rows are returned.

if I try this:

$query_rsShip = "SELECT UIC, Command_Name, Hull_Number FROM command WHERE UIC != ".$uic." ORDER BY $sidx $sord LIMIT $start , $limit";

Again, I get all the rows

Then I thought, alright, lets get all the rows and filter them separately like so:

while($row = mysql_fetch_array($rsShip,MYSQL_ASSOC)) {
    $diff = strcasecmp ( $row['UIC'], $uic);
    if ( $diff == 0) {
        $s .= "<row id='". $row['UIC']."'>";            
        $s .= "<cell>". $row['UIC']."</cell>";
        $s .= "<cell>". $row['Command_Name']."</cell>";
        $s .= "<cell>". $row['Hull_Number']."</cell>";

No rows are returned. If I comment out the if clause, it passes all the rows of data.

I'm completely stumped. I'm not sure what else I could try Cry



About the jQuery Grid Plugin – jqGrid forum

Most Users Ever Online:

157


Currently Online:

83 Guests

Forum Stats:

Groups: 1

Forums: 7

Topics: 9654

Posts: 28935

Membership:

There are 10346 Members

There have been 448 Guests

There is 1 Admin

There are 2 Moderators

Top Posters:

OlegK – 1167

markw65 – 179

kobruleht – 144

phicarre – 126

YamilBracho – 124

Renso – 118

Administrators: admin (56 Posts)

Moderators: tony (7041 Posts), Rumen[Trirand] (81 Posts)




Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information