|
![](/images/resource/spacer.gif) |
|
ใช้ DadaGrid ของ jQuery EasyUI มีปัญหาตรง paging toolbar ครับ |
|
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
ผมกำลังหัดใช้ jQuery ครับ
ผมใช้ framework ของ jQuery EasyUI DataGrid http://www.jeasyui.com/ + ASP Classic + MS Access ครับ
เพจที่เขียนมีวัตถุประสงค์คือ เอาข้อมูลจาก MS Access มาแสดงใน DataGrid ของ EasyUI
จากตัวอย่างที่ EasyUI เขาใช้ php + mySql ซึ่งสามารถส่ง recordset กลับมาแบบแบ่งหน้าให้เลย แต่ ASP + Access ทำไม่ได้ครับ
ไฟล์มี 2 ไฟล์ คือ bib.html และ getBib.asp
ไฟล์ bib.html ใช้แสดงข้อมูลตาราง ส่วนไฟล์ getBib.asp สำหรับเรียกข้อมูล recordset
ผลคือ หลังจากกดปุ่ม next ที่ paging toolbar ในครั้งแรก ข้อมูลในตารางจะเปลี่ยนเป็นของหน้า 2 ให้
แต่พอกด next เพื่อเปลี่ยนหน้า ข้อมูลในตาราง ไม่ยอมเปลี่ยนครับ
ตรงนี้มีปัญหาแทรกเข้ามาอีกคือ เลขหน้าที่ paging toolbar เปลี่ยนเป็น 2 แล้วเด้งกลับเป็น 1
แต่ถ้าโหลดเพจครั้งแรก แล้วลองกรอกเลขหน้าเป็นหน้าอื่น เช่น 5 ก็จะไปที่หน้า 5 ให้ แล้วเด้งกลับเป็น 1 อีก
แต่กดปุ่ม next ก็จะไม่เปลี่ยนหน้าให้อีกแล้ว
ไม่แน่ใจว่า ทำตรงไหนพลาด รบกวนผู้รู้่ ช่วยอนุเคราะห์ด้วยครับ
ไฟล์ bib.html
Code (ASP)
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Test DataGrid Paging</title>
<link rel="stylesheet" type="text/css" href="../easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="../easyui/themes/icon.css">
<script type="text/javascript" src="../easyui/jquery.min.js"></script>
<script type="text/javascript" src="../easyui/jquery.easyui.min.js"></script>
</head>
<body>
<div title="BIB Record" style="padding:20px;">
<table id="bib" name="bib" title="Bibliographic" class="easyui-datagrid" style="width:800px;height:500px">
<thead>
<tr>
<th data-options="field:'id',width:50">ID</th>
<th data-options="field:'author',width:150">Author</th>
<th data-options="field:'title',width:450">Title</th>
<th data-options="field:'isbn',width:100">ISBN</th>
</tr>
</thead>
</table>
</div>
<script type="text/javascript">
$(document).ready(function() {
// set datagrid properties
$('#bib').datagrid({
pagination:true,
url: 'getBib.asp'
});
// get page & row limit
$('#bib').datagrid('getPager').pagination({
onSelectPage:function(page,rows){
//alert(page+":"+rows);
$('#bib').datagrid({
url: 'getBib.asp?Page='+page+'&Limit=15'
});
}
});
});
</script>
</body>
</html>
หน้า 1 ของตาราง
![page1 page1](https://www.thaicreate.com/upload/stock/20140731125847.gif?v=1001)
หน้า 2 ของตาราง
![page2 page2](https://www.thaicreate.com/upload/stock/20140731125934.gif?v=1001)
Tag : ASP, Ms Access, JavaScript, jQuery, Windows
![](/images/adv.jpg?v=1001)
|
ประวัติการแก้ไข 2014-07-31 13:00:18
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2014-07-31 12:56:39 |
By :
Aod47 |
View :
2254 |
Reply :
2 |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
ดูดีมากๆ เลยครับผม ">
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2021-10-09 20:59:10 |
By :
nobody001 |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
|
|
|
![](/images/digitalocean-banner.jpg)
|
Load balance : Server 01
|