Encountering a strange issue with IE11 where the first character typed in an editable cell is being ignored.
The scenario is, when a user enters data into a jqGrid cell and presses TAB, the same cell becomes editable again. However, the problem is that upon becoming editable again, it always ignores the first character typed.
var mydata = [{
name: "Toronto",
country: "Canada",
continent: "North America"
}, {
name: "New York City",
country: "USA",
continent: "North America"
}, {
name: "Silicon Valley",
country: "USA",
continent: "North America"
}, {
name: "Paris",
country: "France",
continent: "Europe"
}]
var gridCtrl = $("#grid").jqGrid({
data: mydata,
datatype: "local",
colNames: ["Name", "Country", "Continent"],
colModel: [{
name: 'name',
index: 'name',
editable: true,
}, {
name: 'country',
index: 'country',
editable: true,
}, {
name: 'continent',
index: 'continent',
editable: true,
}],
pager: '#pager',
cellEdit: true,
cellsubmit: 'clientArray',
afterEditCell: GridAfterEditCell,
beforeSaveCell: GridBeforeSaveCell,
afterRestoreCell: GridAfterRestoreCell,
afterSaveCell: GridAfterSaveCell
});
function GridAfterEditCell(rowid, cellname, value, iRow, iCol) {
}
function GridAfterSaveCell(rowid, cellname, value, iRow, iCol) {
}
function GridBeforeSaveCell(rowid, cellname, value, iRow, iCol) {
alert('some validation alert!!!');
setTimeout(function(){
// refocus on the same cell
gridCtrl.jqGrid('editCell', rowid, iCol, true);
}, 10);
return value;
}
function GridAfterRestoreCell(rowid, value, iRow, iCol) {
}
View the jsfiddle code here: Demo: http://jsfiddle.net/CzVVK/2225/
Steps:
- Access the link in Internet Explorer 11
- Enter data into the first cell
- Press the TAB key
- An alert will appear and the same cell will become editable again
- Type any key (such as character a)
- You'll observe that the first character entered is ignored!!!