igGrid - tooltips on column headers
by georgianastasov
HTML
<script src="https://igniteui.com/js/modernizr.min.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/latest/js/infragistics.core.js"></script>
<script src="https://cdn-na.infragistics.com/igniteui/latest/js/infragistics.lob.js"></script>
<script src="https://igniteui.com/js-data/northwind"></script>
<link href="https://cdn-na.infragistics.com/igniteui/latest/css/themes/infragistics/infragistics.theme.css" rel="stylesheet"></link>
<link href="https://cdn-na.infragistics.com/igniteui/latest/css/structure/infragistics.css" rel="stylesheet"></link>
<table id="grid"></table>
JavaScript
$(function () {
$( "#grid" ).igGrid( {
autoGenerateColumns: false,
autofitLastColumn: false,
width: "100%",
columns: [
{ headerText: "First Name", key: "FirstName", dataType: "string", width: "10%" },
{ headerText: "Last Name", key: "LastName", dataType: "string", width: "10%" },
{ headerText: "Title", key: "Title", dataType: "string", width: "17%" },
{ headerText: "Birth Date", key: "BirthDate", dataType: "date", width: "8%" }
],
dataSource: northwind,
responseDataKey: "results",
features: [
{
name: "Tooltips",
columnSettings: [
{ columnKey: "FirstName", allowTooltips: false },
{ columnKey: "LastName", allowTooltips: false },
{ columnKey: "Title", allowTooltips: false },
{ columnKey: "BirthDate", allowTooltips: false },
],
style: Modernizr.touch ? "popover" : "tooltip",
visibility: "always"
}
]
});
$("#grid_FirstName").attr("title", "First Name");
$("#grid_LastName").attr("title", "Last Name");
$("#grid_Title").attr("title", "Position Title");
$("#grid_BirthDate").attr("title", "Birth Date");
});