igGrid headers role button
by georgianastasov
HTML
<script src="https://ajax.aspnetcdn.com/ajax/modernizr/modernizr-2.8.3.js"></script>
<script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
<script src="https://cdn-na.infragistics.com/igniteui/2023.1/latest/js/infragistics.core.js"></script>
<script src="https://cdn-na.infragistics.com/igniteui/2023.1/latest/js/infragistics.lob.js"></script>
<script src="https://igniteui.github.io/help-samples/data-files/northwind.js"></script>
<link href="https://cdn-na.infragistics.com/igniteui/2023.1/latest/css/themes/infragistics/infragistics.theme.css" rel="stylesheet">
<link href="https://cdn-na.infragistics.com/igniteui/2023.1/latest/css/structure/infragistics.css" rel="stylesheet">
<table id="grid"></table>
JavaScript
$(function () {
$("#grid").igGrid({
autoGenerateColumns: false,
width: "100%",
height: "500px",
columns: [
{ headerText: "Employee ID", key: "EmployeeID", dataType: "number", width: "15%" },
{ headerText: "First Name", key: "FirstName", dataType: "string", width: "20%" },
{ headerText: "Last Name", key: "LastName", dataType: "string", width: "20%" },
{ headerText: "Birth Date", key: "BirthDate", dataType: "date", width: "15%" },
{ headerText: "City", key: "City", dataType: "string", width: "15%" },
{ headerText: "Postal Code", key: "PostalCode", dataType: "string", width: "15%" }
],
dataSource: northwind,
responseDataKey: "results",
features: [
{
name: "Sorting",
type: "local"
}
]
});
$(".ui-iggrid-header").each(function(index) {
$(".ui-iggrid-header")[index].role = "button";
});
});