JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="https://cdn.grapecity.com/wijmo/5.latest/styles/wijmo.min.css">
<script src="https://cdn.grapecity.com/wijmo/5.latest/controls/wijmo.min.js"></script>
<script src="https://cdn.grapecity.com/wijmo/5.latest/controls/wijmo.grid.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<div class="container">
<h3> Test </h3>
<div id="theGrid"></div>
</div>
CSS
.wj-marquee {
border: 8px solid rgba(255,150,30,.75);
border-radius: 8px;
}
body {
margin-bottom: 12px;
}
JavaScript
onload = function() {
var theGrid = new wijmo.grid.FlexGrid('#theGrid', {
showAlternatingRows: false,
showMarquee: true,
itemsSource: getData(),
columns: [
{ binding: 'country', header: 'Country', width: 80, minWidth: 40, maxWidth: 160 },
{ binding: 'downloads', header: 'Downloads', width: '2*', allowResizing: false },
{ binding: 'sales', header: 'Sales', format: 'n0', width: '*', allowResizing: false },
{ binding: 'expenses', header: 'Expenses', format: 'n0', width: '*', allowResizing: false
}
],
});
theGrid.onSelectionChanged = function(e) {
var vmarquee = document.getElementsByClassName("wj-marquee")[0];
var width = parseInt(vmarquee.style.width);
var height = parseInt(vmarquee.style.height);
var left = parseInt(vmarquee.style.left);
var top = parseInt(vmarquee.style.top);
if(width == 0 && height == 0) return;
var border = 8//parseInt(vmarquee.style.borderWidth);
vmarquee.style.width = (width - (2 * border)) + "px";
vmarquee.style.height = (height - (2 * border )) + "px";
vmarquee.style.left = (left + border) + "px";
vmarquee.style.top = (top + border) + "px";
}
// create some random data
function getData() {
var countries = 'US,UK,Germany,France,Italy,Japan,China'.split(','),
data = [];
for (var i = 0; i < countries.length; i++) {
data.push({
country: countries[i],
downloads: Math.round(Math.random() * 20000),
sales: Math.random() * 10000,
expenses: Math.random() * 5000
});
}
return data;
}
}