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
}
],
selectionChanged: () => update(),
updatedView: () => update()
});
function update() {
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);
width = width - 2 * border + "px";
height = height - 2 * border + "px";
left = left + border + "px";
top = top + border + "px";
//get the cell element of the selected cell
var cell = theGrid.cells.getCellElement(
theGrid.selection.row,
theGrid.selection.col
);
// whether the marquee should be updated
var shouldUpdate = true;
if (cell) {
var cellRect = wijmo.getElementRect(cell);
var marqueeRect = wijmo.getElementRect(vmarquee);
// if cell and marquee have the different rect, then update
shouldUpdate = cellRect.left !== marqueeRect.left;
}
// updated accordingly
if (shouldUpdate) {
vmarquee.style.width = width;
vmarquee.style.height = height;
vmarquee.style.left = left;
vmarquee.style.top = top;
}
}
// create some random data
function getData() {
var countries = 'US,UK,Germany,France,Italy,Japan,China'.split(','),
data = [];
for (var i = 0; i < countries.length;...