Next
Update
Prev

The ComboBox can be used in the column header by setting the headerRenderer attribute to ComboBoxHeader. This example demonstrates how to use the ComboBox control in the header of the third column.

...
  <DataGridColumn dataField="ReceiveDate" headerRenderer="ComboBoxHeader" headerRendererDataProvider="[{\'label\'\:\'2013\'},{\'label\'\:\'2014\'}]" />
...

var gridApp, gridRoot, dataGrid;
function gridReadyHandler(id) {
  gridApp = document.getElementById(id);
  gridRoot = gridApp.getRoot();

  gridApp.setLayout(layoutStr);
  gridApp.setData(gridData);

  var headerListChangeHandler = function(event) {
    alert(event.itemRenderer.getSelectedLabel());
  }

  var layoutCompleteHandler = function(event) {
    dataGrid = gridRoot.getDataGrid();
    gridRoot.getObjectById("dg1col3").addEventListener("headerListChange", headerListChangeHandler);
  }

  gridRoot.addEventListener("layoutComplete", layoutCompleteHandler);
}

© 2017 KoolChart. All rights reserved.