igGrid with custom EditorProviderCheckbox working default behavior
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/apiviewer.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>
<link href="https://igniteui.com/css/apiviewer.css" rel="stylesheet" type="text/css"></link>
<table id="grid"></table>
JavaScript
$(function () {
var titles = ["Sales Representative", "Sales Manager", "Inside Sales Coordinator", "Vice President, Sales"];
var countries = ["UK", "USA"];
var northwind = {
results: [
{
EmployeeID: 1,
FirstName: "Nancy",
Title: "Sales Representative",
BirthDate: "1968-12-08T00:00:00",
Country: "USA",
PostalCode: "98122",
IsActive: true
},
{
EmployeeID: 2,
FirstName: "Andrew",
Title: "Vice President, Sales",
BirthDate: "1952-02-19T00:00:00",
Country: "UK",
PostalCode: "WA1 1DP",
IsActive: false
},
{
EmployeeID: 3,
FirstName: "Janet",
Title: "Sales Manager",
BirthDate: "1963-08-30T00:00:00",
Country: "USA",
PostalCode: "94025",
IsActive: true
}
]
};
$.ig.EditorProviderCheckbox = $.ig.EditorProvider.extend({
createEditor: function (callbacks, columnKey, editorOptions, tabIndex, format, element) {
element = element || $('<input>').attr({
type: 'checkbox',
tabindex: tabIndex
});
this._super(callbacks, columnKey, editorOptions, tabIndex, format, element);
element.on('change', $.proxy(this.change, this))
.on('click', $.proxy(this.click, this))
.on('keydown', $.proxy(function (e) {
if (e.keyCode === 9) { // Tab
e.preventDefault();
var shift;
var ui = {};
ui.owner = this.editor.element;
...