プロジェクトhttp://www.tablefixedheader.com/でこのプラグインを使用していますが、テーブルの作成中に動的データを配置する必要があります。
テーブルを構築する Js コードは次のとおりです。
<script type="text/javascript">
$.ajax({
url: 'dialogs/WMS/mytable.php',
success: function(data) {
$('.maintab<?php echo $varc ?>
').html(data).fixheadertable({
colratio : [45, 24, 24, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150 ],
zebra : true,
sortable : true,
sortedColId : 3,
resizeCol : true,
height : 150,
pager : true,
sortType : ['integer', 'string', 'string', 'string', 'string', 'date']
});
}
});
</script>
いくつかのパラメーターを含める必要があります。私が試したこと:
例 1 (成功しない)
<script type="text/javascript">
$.ajax({
url:'dialogs/mytable.php?columns='<?php echo $column ?>,
type: 'post',
success: function(data) {
$('.maintab<?php echo $varc ?>
').html(data).fixheadertable({
colratio : [45, 24, 24, 180, 180, 180, 180, 180,180, 180, 180, 180, 180, 180]
zebra : true,
sortable : true,
sortedColId : 3,
resizeCol : true,
height : 150,
pager : true,
sortType : ['integer', 'string', 'string', 'string', 'string', 'date']
});
}
});
</script>
例 2 (成功しない)
<script type="text/javascript">
$.ajax({
url:'dialogs//mytable.php?columns='<?php $column ?>,
type: 'post',
success: function(data) {
$('.maintab<?php echo $varc ?>
').html(data).fixheadertable({
colratio : [45, 24, 24, 180, 180, 180, 180, 180,180, 180, 180, 180, 180, 180],
zebra : true,
sortable : true,
sortedColId : 3,
resizeCol : true,
height : 150,
pager : true,
sortType : ['integer', 'string', 'string', 'string', 'string', 'date']
});
}
});
</script>
例 3 (成功しない)
<script type="text/javascript">
$.ajax({
url:'dialogs/mytable.php',
data: {
columns: <?php echo $column ?>,
}
type: 'post',
success: function(data) {
$('.maintab<?php echo $varc ?>
').html(data).fixheadertable({
colratio : [45, 24, 24, 180, 180, 180, 180, 180,180, 180, 180, 180, 180, 180],
zebra : true,
sortable : true,
sortedColId : 3,
resizeCol : true,
height : 150,
pager : true,
sortType : ['integer', 'string', 'string', 'string', 'string', 'date']
});
}
});
</script>
例 4 (成功しない)
<script type="text/javascript">
$.ajax({
url:'dialogs/mytable.php',
data: {
columns: <?php $column ?>,
}
type: 'post',
success: function(data) {
$('.maintab<?php echo $varc ?>
').html(data).fixheadertable({
colratio : [45, 24, 24, 180, 180, 180, 180, 180,180, 180, 180, 180, 180, 180],
zebra : true,
sortable : true,
sortedColId : 3,
resizeCol : true,
height : 150,
pager : true,
sortType : ['integer', 'string', 'string', 'string', 'string', 'date']
});
}
});
</script>
開発者からの回答はなく、フォーラムでも同様のものは見つかりませんでした。誰もが進む方法を知っていますか?