Hi, Has anyone tried the responsive layout in Kvi...
# kvision
k
Hi, Has anyone tried the responsive layout in Kvision tabulator? I gave this, but could not see the any changes when I see it various screen sizes..
Copy code
options = TabulatorOptions(
                        layout = Layout.FITCOLUMNS,
                        responsiveLayout = ResponsiveLayout.COLLAPSE,.....
r
It looks a bit strange for me, as well. There is some kind of difference, but I would expect something else.
It probably works better when there are a lot of columns with not-collapsable content.
But with typical tables I mostly use, this mode make almost no difference.
Of course - it's not KVision. It just how tabulator works.
k
I have four columns with contents, which is too many for a small screen. I will try to add more columns to see if it works.
r
I think you need to have manually set fixed width for columns.
If the columns can shrink - they will just shrink, and there will be no collapsing.
k
I see.. I tried with 10 columns, and I even tried the layout to fitDataFill as per the example in the tabulator :
Copy code
var table = new Tabulator("#example-table", {
    height:"311px",
    layout:"fitDataFill",
    responsiveLayout:"collapse",
    columns:[
    {formatter:"responsiveCollapse", width:30, minWidth:30, hozAlign:"center", resizable:false, headerSort:false},
    {title:"Name", field:"name", width:200, responsive:0},
    {title:"Progress", field:"progress", hozAlign:"right", sorter:"number", width:150},
    {title:"Gender", field:"gender", width:150, responsive:2},
    {title:"Rating", field:"rating", hozAlign:"center", width:150},
    {title:"Favourite Color", field:"col", width:150},
    {title:"Date Of Birth", field:"dob", hozAlign:"center", sorter:"date", width:150},
    {title:"Driver", field:"car", hozAlign:"center", width:150},
    ],
});
I will try to set the width and minwidth
ah there is another formatter setting..
Dont know how to give this setting inside the ColumnDefinition:
Copy code
{formatter:"responsiveCollapse", width:30, minWidth:30, hozAlign:"center", resizable:false, headerSort:false},
Somehow the responsive layout renders in rows when I give this:
Copy code
responsiveLayoutCollapseUseFormatters = true,
responsiveLayoutCollapseStartOpen = true,
responsiveLayout = ResponsiveLayout.COLLAPSE,
But it seems it is buggy, as I have tabulators in different tabs, when I switch tabs, it throws errors in console:
Copy code
Uncaught TypeError: onRendered is not a function
I will leave it non-responsive for now, until I get any other react component for adding dynamic rows for my requirement
r
this onRendered bug could be somehow KVision fault - please fill an issue for this
k
sure will do.. Thanks again!