所以,我有一个文件(incident_view.php),其中包含来自数据库的数据。一切正常,我正在使用数据表...
但是,我还有另一个页面(状态.php),我正在使用 onclick 在 JQuery 对话框"incident_view.php"页面中打开它......一切正常,Jquery 对话框打开时显示正确的数据,但该表没有"数据表"布局:(
我的代码处于状态.php:
<body>
<?php
$plant="MNovo";
?>
<div id="dialog" title="Plant incidents">
</div>
<script>
function incbox() {
$( "#dialog" ).load('incident_view.php?idplant=<?php echo $plant ?>').dialog({ width:1000, maxHeight: 500 });
$( "#opener" ).click(function() {$( "#dialog" ).dialog( "open" );});
}
</script>
<a href="javascript:incbox()"><?php echo utf8_encode("$plant");?></a>
</body>
它有什么问题? :/
PS:"incident_view.php"中的数据表初始化
<script type="text/javascript" charset="utf-8">
$(document).ready( function () {
$('#inctables').dataTable( {
"aLengthMenu": [[10,25, 50, -1], [10,25, 50, "All"]],
"iDisplayLength": -1,
"bScrollInfinite": true,
"bScrollCollapse": true, //Scroll...
"scrollY": "270px",
"deferRender": true,
"aaSorting": [],
"order": [ [1,'desc'], [0,'asc'] ], //Order colmns by timestamp and equipment (inverter)
} );
} );
</script>
在stackoverflow上还有其他类似的问题 - JQuery加载似乎无法处理