Hi,
I have a html page that shows a dynamic 3-colum layout. the left- and right-most columns are fixed width and the middle column is dynamic according to available page width.
In the middle column i want to place a webix datatable (#results_datatable) that uses all of the available width of the middle column. the datatable gets it content from a url in chunks.
Currently i use this code to initialize the datatable:
<div id="resultlist">
<div id="results_datatable"></div>
</div>
<script type="text/javascript">
var grid = new webix.ui({
view:"datatable",
container: "results_datatable",
columns:[
{id:"runstatus", header:"", adjust:"data"},
{id:"name", header:"Name", fillspace:2},
{id:"total", header:"Total", adjust:"data"},
{id:"pfe_bubbles", header:"Distribution", adjust:"data"},
{id:"cat_full", header:"Category", fillspace:3},
{id:"startedat_f", header:"Started at", adjust:"data"},
{id:"duration_f", header:"Duration", adjust:"data"}
],
url: '/get/my/data/here',
navigation: true,
select: true,
minHeight: 400,
minWidth: 600,
headerRowHeight:20,
rowHeight:20,
scrollX:false,
autowidth: true
});
</script>
I also have a css to maximize the width of the #resultlist div (with respect to some margin)
#resultlist {
margin-left: 10px;
margin-right: 10px;
}
As a result of this, i get a #results_datatable that is 671px wide, even though the #resultlist is 1251px wide. Both columns that are configured with fillspace are 100px wide (name and cat_full). All other columns are as wide as they should be depending on the data they show.
If i remove the autowidth: true, then the #results_datatable grows too large to 1430px (pushing the right column (of the surrounding page) out of the screen as the #resultlist is expanded too), but the two fillspace columns “scale as expected” (slightly too large, but compared to before they expand).
What am i doing wrong? I would like to have a table that uses the maximum available width without creating a horizontal scrollbar.
Regards,
Marc