EasyUI Forum
June 26, 2024, 07:31:13 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Combogrid Pagination with 6000 data's  (Read 5298 times)
anugrast
Jr. Member
**
Posts: 52


View Profile Email
« on: November 21, 2016, 01:46:12 AM »

Dear All...

I've create combogrid with pagination that contains about 6000 data's... It works well (see combogrid-oke.jpg)...

Problems arise on edit mode when its value was on page 2 (on page 1 it works fine - combogrid-oke-oke.jpg) and so only appear idField (without textField - see combogrid-not-oke.jpg). How to fix it? Can anyone help me?

This is my code

HTML
Code:
<input id="asptimsmhs_datamhs" name="asptimsmhs" class="easyui-combogrid" style="width:95%;height:20px;" prompt="Pilih" data-options="
panelWidth:400,panelHeight:'auto',
url: '_modul/mod_datamhs/aksi_datamhs.php?act=asal_pt',
idField:'kdptitbpti', textField:'nmptitbpti', mode:'remote',
pagination:true, pageSize:10, pageList: [10],
multiple:false,fitColumns:true,
columns:[[
{field:'kdptitbpti',title:'Kode',align:'center',width:50},
{field:'nmptitbpti',title:'Nama Perguruan Tinggi',width:250}
]],
"
>

PHP:
Code:
	$q = isset($_POST['q']) ? strval($_POST['q']) : '';
$page = isset($_POST['page']) ? intval($_POST['page']) : 1;
$rows = isset($_POST['rows']) ? intval($_POST['rows']) : 15;
$offset = ($page-1)*$rows;

$result = array();
$sql = "SELECT kdptitbpti,nmptitbpti FROM _tbpti WHERE kdptitbpti LIKE '%$q%' OR nmptitbpti LIKE '%$q%'";
$res = $conDB->query($sql);
$result["total"] = $res->num_rows;

$sql="SELECT kdptitbpti,nmptitbpti FROM _tbpti WHERE kdptitbpti LIKE '%$q%' OR nmptitbpti like '%$q%' limit $offset,$rows";
$res = $conDB->query($sql);
$rows = array();
while($row = $res->fetch_assoc()){
array_push($rows, $row);
}

$result["rows"] = $rows;
echo json_encode($result);

Please help.... Thx
« Last Edit: November 21, 2016, 01:48:18 AM by anugrast » Logged
jarry
Administrator
Hero Member
*****
Posts: 2267


View Profile Email
« Reply #1 on: November 21, 2016, 07:16:29 AM »

Please look at this topic http://www.jeasyui.com/forum/index.php?topic=6212.0
Logged
anugrast
Jr. Member
**
Posts: 52


View Profile Email
« Reply #2 on: November 21, 2016, 06:26:24 PM »

Thanks for your solution... Finally I've reload my combogrid with new query like this
Code:
dg.datagrid('reload', {
  act: 'asal_pt',q:row.asptimsmhs
});

Thx

Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!