Çözümü, belki ihtiyacı olanlar olur diye paylaşıyorum.
controller
public function getData($response = false){
$response = [];
$qpost = $_POST["searchPhrase"];
$basla = intval($_REQUEST['current']);
$uzunluk = intval($_REQUEST['rowCount'] * $basla);
$basla = $basla != 1 ? (( $basla - 1 ) * 10 + 1) : 1;
if($qpost == "") {
$rows = $this->db->query("SELECT *
FROM
(SELECT ROW_NUMBER() OVER (ORDER BY id) AS RowNum, * FROM yer) AS RowConstrainedResult
WHERE RowNum >= $basla AND RowNum <= $uzunluk
ORDER BY RowNum
")->result();
$total = $this->db->query("SELECT COUNT(id) AS total FROM yer")->row();
} else{
$rows = $this->db->query("SELECT *
FROM
(SELECT ROW_NUMBER() OVER (ORDER BY id) AS RowNum, * FROM yer WHERE yer_adi LIKE '%".$qpost."%') AS RowConstrainedResult
WHERE RowNum >= $basla AND RowNum <= $uzunluk
ORDER BY RowNum
")->result();
$total = $this->db->query("SELECT COUNT(id) AS total FROM yer WHERE yer_adi LIKE '%".$qpost."%'")->row();
}
if ($rows){
$response =
array(
'current' => intval($_REQUEST['current']),
'rowCount' => $uzunluk,
'rows' => '',
'total' => $total->total,
'draw' => intval($_REQUEST['current'])
);
foreach ($rows as $row) {
$response['rows'][] =
array(
'id' => $row->id,
'yer_adi' => $row->yer_adi,
'ilceID' => $row->ilceID,
'islem' => '<a href="" class="btn btn-primary btn-xs waves-effect">Düzenle</a>
<a href="" class="btn btn-warning btn-xs waves-effect">Sil</a>'
);
}
}
echo json_encode($response);
}view <div class="table-responsive">
<table id="grid-data" class="table table-condensed table-hover table-striped" data-toggle="bootgrid" data-ajax="true" data-url="getData">
<thead>
<tr>
<th data-column-id="id" data-type="numeric" data-sortable="false">ID</th>
<th data-column-id="yer_adi" data-sortable="false">Yer / Mekan Adı</th>
<th data-column-id="ilceID" data-sortable="false">İlçe</th>
<th data-column-id="islem" data-sortable="false">İşlem</th>
</tr>
</thead>
</table>
</div>