tabulator table 不呈现某些列值。想知道为什么?
tabulator table doesn't render some column values. wondering why?
我得到了一个临时的 table,它是从程序创建的。我将它分配给变量,然后将其转换为 json 并传递到我的 laravel 项目的视图。当我加载我的页面时 table 已呈现,但某些列值是 missing.i 想知道为什么吗?
我在 MySQL Workbench 中 运行 它并且所有数据都正常显示。这是它的 HTML 结果:https://jsfiddle.net/iBek23/z5pdsjob/
控制器:
public function tabulator(){
DB::select("CALL report1a_respublika('2000/01/01', '2023/01/01')");
$one = DB::select("SELECT * FROM test");
$one = json_encode($one);
return view ('reports.tabulator', compact('one'));
查看:
{{-- tabulator tables --}}
<div style='display:none' id="tableZero"></div>
<div id="tableOne" style="margin-top:15px"></div>
{{-- tabulator script --}}
<script>
//define data for table1
var tabledata1 = {!!$one!!}
var table0 = new Tabulator("#tableZero", {
layout: "fitDataFill", //fit columns to width of table (optional)
autoColumns: true,
});
//define table1
var table1 = new Tabulator("#tableOne", {
data: tabledata1,
autoColumns:true,
layout:"fitDataFill",
movableColumns:true,
selectable:true,
clipboard:true,
});
//trigger download of data.xlsx file
var sheets = {
"sheetA": table1,
};
downloadXlxs = function(){
table0.download("xlsx", "report.xlsx", {sheets:sheets});
};
</script>
这是我得到的:https://jsfiddle.net/iBek23/wf0xernz/5/
第 5、6 和 7 列(从左到右数)没有任何值。
Replace Period '.' with .
看到这个jsfiddle你可以看到第一项,重复这个
.\u0411\u0438\u0448\u043a\u0435\u043a":12,
我得到了一个临时的 table,它是从程序创建的。我将它分配给变量,然后将其转换为 json 并传递到我的 laravel 项目的视图。当我加载我的页面时 table 已呈现,但某些列值是 missing.i 想知道为什么吗?
我在 MySQL Workbench 中 运行 它并且所有数据都正常显示。这是它的 HTML 结果:https://jsfiddle.net/iBek23/z5pdsjob/
控制器:
public function tabulator(){
DB::select("CALL report1a_respublika('2000/01/01', '2023/01/01')");
$one = DB::select("SELECT * FROM test");
$one = json_encode($one);
return view ('reports.tabulator', compact('one'));
查看:
{{-- tabulator tables --}}
<div style='display:none' id="tableZero"></div>
<div id="tableOne" style="margin-top:15px"></div>
{{-- tabulator script --}}
<script>
//define data for table1
var tabledata1 = {!!$one!!}
var table0 = new Tabulator("#tableZero", {
layout: "fitDataFill", //fit columns to width of table (optional)
autoColumns: true,
});
//define table1
var table1 = new Tabulator("#tableOne", {
data: tabledata1,
autoColumns:true,
layout:"fitDataFill",
movableColumns:true,
selectable:true,
clipboard:true,
});
//trigger download of data.xlsx file
var sheets = {
"sheetA": table1,
};
downloadXlxs = function(){
table0.download("xlsx", "report.xlsx", {sheets:sheets});
};
</script>
这是我得到的:https://jsfiddle.net/iBek23/wf0xernz/5/
第 5、6 和 7 列(从左到右数)没有任何值。
Replace Period '.' with .
看到这个jsfiddle你可以看到第一项,重复这个
.\u0411\u0438\u0448\u043a\u0435\u043a":12,