Demo - FlexGridFilter

by Manish Gupta

HTML

<link rel="stylesheet" href="http://cdn.wijmo.com/5.latest/styles/wijmo.min.css">
<script src="http://cdn.wijmo.com/5.latest/controls/wijmo.min.js"></script>
<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>
<script src="http://cdn.wijmo.com/5.latest/controls/wijmo.grid.filter.min.js"></script>
<script src="http://cdn.wijmo.com/5.latest/controls/wijmo.odata.min.js"></script>
<div class="container">

  <h1>
    FlexGridFilter</h1>
  <p>
    The <b>wijmo.grid.filter</b> module provides a <b>FlexGridFilter</b>
    class that adds an Excel-style filtering UI to each column.</p>
  <p>
    The <b>FlexGridFilter</b> adds filter icons to the column headers.
    Users may click the icons to see a drop-down where they can apply
    filters by value or by condition:</p>
  <div id="theGrid">
  </div>
</div>

CSS

.wj-flexgrid {
  max-height: 250px;
  margin:10px 0;
}
body {
  margin-bottom: 20px;
}
input[type='radio']:focus{
  outline:#0085c7 solid 1px;
}

JavaScript

onload = function () {

  // generate some random data
  var countries = 'US,Germany,UK,Japan,Italy,Greece'.split(','),
      data = [];
  for (var i = 0; i < 20000; i++) {
    data.push({
    	id: i,
      country: countries[i % countries.length],
      downloads: Math.round(Math.random() * 20000),
      sales: Math.random() * 10000,
      expenses: Math.random() * 5000,
    });
  }

	// FlexGridFilter client-side filtering
  var theGrid = new wijmo.grid.FlexGrid('#theGrid', {
    itemsSource: data,
  });
  var filter = new wijmo.grid.filter.FlexGridFilter(theGrid);
}