The best solution would probably be to create a custom css class and use flexboxes to expand horizontally instead of vertically.
This will require some knowledge about styling.
Flexboxes are pretty awesome. There's a good guide to start you with them here
https://css-tricks.com/snippets/css/a-guide-to-flexbox/
To make modifications to your theme folder it's recommended to make additions to the scss files in the theme folder, not the css files. This means you will need a scss compiler. I personally use Koala. But other people like using Gulp. There's a lot of content to be found on the forums/documentation about this.
EDIT: The above assumes you're stuck with using a listview. if you're not bound to having a listview, you can also use a template grid with 1 row and 7 columns. Which would save you some styling headache.
Related
Good idea for a widget/feature, this shows you can do it, with the grid still nominally functioning
Picture
JS
function TransposeTable(tableId){
var tbl = tableId;
var tbody = tbl.find('tbody');
var oldWidth = 0;
jQuery('tr:nth-child(1) td').each(function () {
if (jQuery(this).attr('colspan')) {
oldWidth += +jQuery(this).attr('colspan');
} else {
oldWidth++;
}
});
var oldHeight = tbody.find('tr').length;
var newWidth = oldHeight;
var newHeight = oldWidth;
var jqOldCells = tbody.find('td');
var newTbody = jQuery("<tbody></tbody>");
//for(var y=newHeight; y>=0; y--)//reverse
for(var y=0; y<newHeight; y++)
{
var newRow = jQuery("<tr></tr>");
//for(var x=0; x<newWidth; x++)//reverse
for(var x=newWidth; x>0; x--)
{
newRow.append(jqOldCells.eq((oldWidth*x)+y));
}
newTbody.append(newRow);
}
tbl.addClass('rotate');
tbody.replaceWith(newTbody);
}
TransposeTable(jQuery('.mx-grid .mx-datagrid-body-table'));
CSS [not namespaced]
.mx-datagrid-content-wrapper{
display:flex;
}
.mx-datagrid-head{
display:inline-block!important;;
}
.mx-datagrid-head-table{
display:unset!important;
}
.mx-datagrid-body{
display:inline-block!important;
}
.mx-datagrid-body-table{
display:inline-block!important;
}
.mx-datagrid-head>tr>th{
display:flex;
}
.mx-datagrid-head *{
padding:unset!important;
}
.mx-datagrid-head>tr>th{
padding:3px!important;
margin:2px;!important;
width:128px;
}
Okay, I found a workaround. What I have done is the following:
The result!
Feedback is welcome...