title: removing columns from jqgrid
body: <p>I would like to add my own column names in jqgrid and also i want to prevent the column names that is automatically added by php-jqgrid according to sql query.</p>
  
  <p>I am using php-jqgrid.</p>
  
  <p>Actually jqgrid getting the column name from mysql table's column name and my db table has about 55 column, but all columns are necessary for further calculations . so i want to just print only 12 selected columns not all other rest columns.</p>
  
  <p>I am disabling other column like this :- </p>
  
  <pre><code>$grid-&gt;setColProperty("lat", array("hidden"=&gt;true));
  $grid-&gt;setColProperty("lng", array("hidden"=&gt;true));
  $grid-&gt;setColProperty("clinic_id", array("hidden"=&gt;true));
  $grid-&gt;setColProperty("id", array("hidden"=&gt;true));
  .....
  .....
  .....
  </code></pre>
  
  <p>But it is complex to set every column hidden/disable. Requires code for every column set to hidden/disable.</p>
  
  <p>Is there any sort method to hide/disable rest columns form grid.</p>
  
  <p>I am using this code to do that, but its also getting the name of columns which i have not declare in the method $grid->setColModel(null, null, $mylabels);</p>
  
  <p>Can anyone please tell me what short code i should to write for removing extra added column in jqgrid.</p>
  
  <p>Thanks a lot.</p>
  
  <pre><code>require_once '/var/www/html/zbajtmp/public/jqgrid/jq-config.php';
  // include the jqGrid Class
  require_once "/var/www/html/zbajtmp/public/jqgrid/php/jqGrid.php";
  // include the driver class
  require_once "/var/www/html/zbajtmp/public/jqgrid/php/jqGridPdo.php";
  // Connection to the server
  $conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD);
  // Tell the db that we use utf-8
  $conn-&gt;query("SET NAMES utf8");
  
  // Create the jqGrid instance
  $grid = new jqGridRender($conn);
   // Write the SQL Query
  //$grid-&gt;SelectCommand = 'SELECT OrderID, OrderDate, CustomerID, Freight, ShipName  FROM orders';
  $grid-&gt;SelectCommand = 'SELECT *  FROM clinic';
  // set the ouput format to json
  $grid-&gt;dataType = 'json';
  // Let the grid create the model
  //$grid-&gt;setColModel();
  $mylabels = array(
  "clinic_name"=&gt;"Clinic ame",
  "clinic_address"=&gt;"Address",
  "HomePhone"=&gt;"Home Phone",
  "WorkPhone"=&gt;"Work Phone",
  "Email_Id"=&gt;"Email",
  );
  // Let the grid create the model with the desired labels
  $grid-&gt;setColModel(null, null, $mylabels);
  
  $grid-&gt;setColProperty("lat", array("hidden"=&gt;true));
  $grid-&gt;setColProperty("lng", array("hidden"=&gt;true));
  $grid-&gt;setColProperty("clinic_id", array("hidden"=&gt;true));
  $grid-&gt;setColProperty("id", array("hidden"=&gt;true));
  .....
  .....
  .....
  // Set the url from where we obtain the data
  //$grid-&gt;setUrl('/var/www/html/zbajtmp/application/views/scripts/clinic/grid.php');
  $grid-&gt;setUrl('http://sunlinux/zbajtmp/application/views/scripts/clinic/grid.php');
  // Set grid caption using the option caption
  $grid-&gt;setGridOptions(array(
      "caption"=&gt;"This is my custom Caption...",
      "rowNum"=&gt;50,
      "sortname"=&gt;"id",
      "hoverrows"=&gt;true,
      "rowList"=&gt;array(20,50,100,1000),
      "width"=&gt;"100%",
      "height"=&gt;350,
  "footerrow"=&gt;true,
  "rownumbers"=&gt;true,
  "multiselect"=&gt;true,
  "altRows"=&gt;true,
  "altclass"=&gt;'clsalt',
  "loadtext"=&gt;"&lt;div class='loadingbox'&gt;Please wait. Loading...&lt;/div&gt;",
  
      ));
  
  
  $grid-&gt;renderGrid('#grid','#pager',true, null, null, true,true);
  
  
  $conn = null;  
  </code></pre>
  
  <p>Thanks a lot.</p>