Note that there are some explanatory texts on larger screens.

plurals
  1. POjqGrid not working on Live Site
    primarykey
    data
    text
    <p>Hello I've been working on this for almost 2 hours now. I can't seem to find the error about the result not being shown on jqGrid. I tried echoing json_encode and it displayed. My jqGrid is working on my local site but not on the live one. I am passing a parameter so that it will not show other items that are not included.</p> <p>Here's what I got:</p> <p>//Controller</p> <pre><code>function all ($eid) { $page = isset($_POST['page'])?$_POST['page']:1; $limit = isset($_POST['rows'])?$_POST['rows']:10; $sidx = isset($_POST['sidx'])?$_POST['sidx']:'rank'; $sord = isset($_POST['sord'])?$_POST['sord']:''; $start = $limit*$page - $limit; $start = ($start&lt;0)?0:$start; $where = ""; $searchField = isset($_POST['searchField']) ? $_POST['searchField'] : false; $searchOper = isset($_POST['searchOper']) ? $_POST['searchOper']: false; $searchString = isset($_POST['searchString']) ? $_POST['searchString'] : false; if (isset($_POST['_search']) == 'true') { $ops = array( 'eq'=&gt;'=', 'ne'=&gt;'&lt;&gt;', 'lt'=&gt;'&lt;', 'le'=&gt;'&lt;=', 'gt'=&gt;'&gt;', 'ge'=&gt;'&gt;=', 'bw'=&gt;'LIKE', 'bn'=&gt;'NOT LIKE', 'in'=&gt;'LIKE', 'ni'=&gt;'NOT LIKE', 'ew'=&gt;'LIKE', 'en'=&gt;'NOT LIKE', 'cn'=&gt;'LIKE', 'nc'=&gt;'NOT LIKE' ); foreach ($ops as $key=&gt;$value){ if ($searchOper==$key) { $ops = $value; } } if($searchOper == 'eq' ) $searchString = $searchString; if($searchOper == 'bw' || $searchOper == 'bn') $searchString .= '%'; if($searchOper == 'ew' || $searchOper == 'en' ) $searchString = '%'.$searchString; if($searchOper == 'cn' || $searchOper == 'nc' || $searchOper == 'in' || $searchOper == 'ni') $searchString = '%'.$searchString.'%'; $where = "$searchField $ops '$searchString'"; } if(!$sidx) $sidx =1; //$this-&gt;db-&gt;where('event_id', $eid); $count = $this-&gt;db-&gt;count_all_results('table1'); if( $count &gt; 0 ) { $total_pages = ceil($count/$limit); } else { $total_pages = 0; } if ($page &gt; $total_pages) $page=$total_pages; $query = $this-&gt;Manager_model-&gt;getcontentfromtable($start,$limit,$sidx,$sord,$where, $eid); $responce-&gt;page = $page; $responce-&gt;total = $total_pages; $responce-&gt;records = $count; $i=0; foreach($query as $row) { $responce-&gt;rows[$i]['rank']=$row-&gt;rank; $pace = time_to_sec($row-&gt;runner_time)/$row-&gt;runner_cat; $pacex = sec_to_time($pace); $responce-&gt;rows[$i]['cell']=array($row-&gt;rank,$row-&gt;runner_name,$row-&gt;runner_cat,$row-&gt;runner_bib,$row-&gt;runner_time,$pacex); $i++; } echo json_encode($responce); } //View &lt;table id="list" cellpadding="0" cellspacing="0"&gt;&lt;/table&gt; &lt;div id="pager" class="scroll" style="text-align:center;"&gt;&lt;/div&gt; &lt;/div&gt; &lt;script type="text/javascript"&gt; $(document).ready(function (){ jQuery("#list").jqGrid({ url: '&lt;?php echo MAINSITE_INDEX."manager/all/$eid" ?&gt;', //another controller function for generating data mtype : "post", //Ajax request type. It also could be GET datatype: "json", //supported formats XML, JSON or Arrray colNames:['Rank','Runner Name','Category','BIB','Time','Pace'], //Grid column headings colModel :[{ name:'rank' ,index:'rank' ,width:55 },{ name:'runner_name' ,index:'runner_name' ,width:90 ,editable:true },{ name:'runner_cat' ,index:'runner_cat' ,width:80 ,align:'right' ,editable:true },{ name:'runner_bib' ,index:'runner_bib' ,width:80 ,align:'rbib' ,editable:true },{ name:'runner_time' ,index:'runner_time' ,width:80 ,align:'right' ,editable:true },{ name:'pacex' ,index:'pacex' ,width:150 ,sortable:false ,editable:false }], rowNum:10, width: 1050, height: 300, rowList:[10,20,30], pager: '#pager', sortname: 'rank', viewrecords: true, rownumbers: true, gridview: true, caption:"List", viewPagerButtons: true }).navGrid('#pager',{edit:true,add:false,del:false}); }); &lt;/script&gt; Model: function getcontentfromtable($start, $limit, $sidx, $sord, $where, $eid){ $this-&gt;db-&gt;select('*'); $this-&gt;db-&gt;limit($limit); $this-&gt;db-&gt;where('event_id', $eid); if($where != NULL) $this-&gt;db-&gt;where($where,NULL,FALSE); $this-&gt;db-&gt;order_by($sidx,$sord); $query = $this-&gt;db-&gt;get('table1',$limit,$start); return $query-&gt;result(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload