Wijmo 5 - FlexGrid
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.input.min.js"></script>
<script src="http://cdn.wijmo.com/5.latest/controls/wijmo.grid.min.js"></script>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<div class="container">
<h1>FlexGrid</h1>
<h3><b>keyActionTab</b> & <b>keyActionEnter</b></h3>
<p>
These properties are used to define the behavior of the Tab and Enter keys on the FlexGrid.The optional enums are:
</p>
<ul>
<li>None</li>
<li>MoveDown</li>
<li>MoveAcross</li>
<li>Cycle</li>
</ul>
<div id="theGrid"></div>
</div>
CSS
.wj-flexgrid {
height: 200px;
margin-bottom:24px
}
JavaScript
// create some random data
var countries = 'US,Germany,UK,Japan,Italy,Greece'.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
});
}
// initialize a grid in code
var grid = new wijmo.grid.FlexGrid('#theGrid', {
autoGenerateColumns: false,
itemsSource: data,
keyActionTab: "Cycle",
keyActionEnter: "None",
selectionMode: "Cell",
columns: [
{ binding: 'country', header: 'Country' },
{ binding: 'downloads', header: 'Downloads' },
{ binding: 'sales', header: 'Sales', format: 'c' },
{ binding: 'expenses', header: 'Expenses', format: 'c' }
]
});