我試圖在我的網站上設置flexigrid ...
除了數據從未加載的事實,一切似乎都很好!
它停留在「正在處理,請等待」 Flexigrid jquery插件卡在「正在處理中,請稍候」
這裏是我的html文件:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" href="jQuery/flexiGrid/css/flexigrid.css" />
<script type="text/javascript" src="jQuery/flexiGrid/jquery.pack.js"></script>
<script type="text/javascript" src="jQuery/flexiGrid/js/flexigrid.js"></script>
<link rel="stylesheet" href="jQuery/style.css" type="text/css" media="screen"/>
<link rel="stylesheet" href="styles.css" type="text/css"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Bird Eye View Flexi Comment Box</title>
<script type="text/javascript">
$(document).ready(function(){
$("#flex1").flexigrid
(
{
url: 'get_domains.php?client_id=1',
dataType: 'json',
colModel : [
{display: 'ID', name : 'domain_id', width : 100, sortable : true, align: 'center'},
{display: 'Domain Name', name : 'domain_name', width : 560, sortable : true, align: 'left'},
{display: 'Time Stamp', name : 'timestamp', width : 100, sortable : true, align: 'left'}
],
buttons : [
{name: 'Delete', bclass: 'delete', onpress : test},
],
sortname: "ID",
sortorder: "asc",
usepager: true,
title: 'Fudge',
useRp: true,
rp: 10,
showTableToggleBtn: false,
width: 760,
height: 255
}
);
});
function sortAlpha(com)
{
jQuery('#flex1').flexOptions({newp:1, params:[{name:'letter_pressed', value: com},{name:'qtype',value:$('select[name=qtype]').val()}]});
jQuery("#flex1").flexReload();
}
function test(com,grid)
{
if (com=='Delete')
{
if($('.trSelected',grid).length>0){
if(confirm('Delete ' + $('.trSelected',grid).length + ' items?')){
var items = $('.trSelected',grid);
var itemlist ='';
for(i=0;i<items.length;i++){
itemlist+= items[i].id.substr(3)+",";
}
$.ajax({
type: "POST",
dataType: "json",
url: "delete.php",
data: "items="+itemlist,
success: function(data){
alert("Query: "+data.query+" - Total affected rows: "+data.total);
$("#flex1").flexReload();
}
});
}
} else {
return false;
}
}
else if (com=='Add')
{
alert('Add New Item Action');
}
} </script>
</head>
<body>
<div id="container">
<div id="header">
<h1>Flexi Comment Box Bird Eye View</h1>
<h3>Hello <?php echo $row_getClientName['first_name']; ?>,</h3>
</div>
<div id="navigation">
<ul>
<li><a href="bird_eye_view_hub.php">Home</a></li>
<li><a href="#">Domains</a></li>
<li><a href="bird_eye_view_pages.php">Pages</a></li>
<li><a href="bird_eye_view_comments.php">Comments</a></li>
<li><a href="#">Support</a></li>
</ul>
</div> <!--end of navigation-->
<div id="content">
<table id="flex1" style="display:none"></table>
<br /><br />
</div><!--contents div ends here-->
</div><!--container ends here-->
</body>
</html>
<?php
mysql_free_result($getClientName);
mysql_free_result($doms);
mysql_free_result($NumOfPages);
mysql_free_result($NumOfComments);
?>
有趣的是,我可以得到的數據只是在我的Dreamweaver中測試瀏覽器很好..
有人可以請我指出正確的方向嗎?
我相信我不是很遙遠,即時消息即將到來!只是一個微調,我會到達那裏! –