I'm using the JS Webix
plugin to create grid
dynamic.
It has a functionality to export to PDF / Excel, the site has the following example:
grid = new webix.ui({
view:"datatable",
columns:[...],
"export":true
});
and to activate, the button:
<input type="button" value="Get as PDF" style='width:400px;margin:25px;' onclick="grid.exportToPDF();">
Where grid
is the instance of webix.ui
that contains datatable
How do I export if datatable
is inside a layout?
Example:
new webix.ui({
type:"line", id:"a1", rows:[
{type:"head", padding:0, responsive:"a1", cols:[
{template:"<?=$rel->getHeader_logo()?>", css:"cabecalho-webix", height:84, minWidth:200},
{template:"<?=$rel->getHeader_titulo()?>", css:"cabecalho-webix", height:84, minWidth:300},
{template:"<?=$rel->getHeader_dataemissao()?>", css:"cabecalho-webix", height:84, minWidth:200}
]},
{type:"line", padding:0, responsive:"a1", cols:[
{
container:"testA",
view:"datatable",
columns: <?= $json; ?>,
footer:false,
autoheight:false,
data:<?= $json_body; ?>,
scrollAlignY:true,
export:true,
resizeColumn:true,
resizeRow:false,
dragColumn:true
}
]},
{type:"line", padding:0, responsive:"a1", cols:[
{template:"<span id='imprimir' onclick='printGrid();'><img src='images/bt_imprimir.png'></span>", height:60}
]}
]
}).show();