FlexGrid - Cell Merging
display row with message "No data available"
by Troy Taylor
HTML
<script src="http://cdn.wijmo.com/5.latest/controls/wijmo.min.js"></script>
<link rel="stylesheet" href="http://cdn.wijmo.com/5.latest/styles/wijmo.min.css">
<script src="http://cdn.wijmo.com/5.latest/controls/wijmo.grid.min.js"></script>
<div id="flex">
</div>
JavaScript
// create the FlexGrid (unbound)
var flex = new wijmo.grid.FlexGrid('#flex');
// give the grid two rows and 3 columns
while (flex.rows.length < 1) {
flex.rows.push(new wijmo.grid.Row());
}
var i = 0;
while (flex.columns.length < 3) {
flex.columns.push(new wijmo.grid.Column({
header: "Col "+i++,
}));
}
// enable merging
flex.allowMerging = 'Cells';
flex.rows[0].allowMerging = true; // merge adjacent cells in rows with same content
if(flex.itemsSource == null){
for (var col = 0; col <= 2; col++) {
flex.setCellData(0, col, 'No Data available...');
}
}