Posted 7 February 2019, 2:03 am EST
this.autoSearch=false;
var _thisGridObj =this;
this.hostElement.addEventListener(‘keypress’, function (e) {
//logic for autoSearch
if ( _thisGridObj.autoSearch) {
var d = !1,
s = _thisGridObj.selection,
o = _thisGridObj;
if (e.charCode > 32 || 32 == e.charCode && _thisGridObj._search) {
e.preventDefault(), _thisGridObj._search += String.fromCharCode(e.charCode).toLowerCase(), _thisGridObj._toSearch && clearTimeout(_thisGridObj._toSearch), _thisGridObj._toSearch = setTimeout(function () {
_thisGridObj._toSearch = null, _thisGridObj._search = “”
}, 500);
var g = _thisGridObj._findNext(s.row, s.col);
g < 0 && _thisGridObj._search.length > 1 && (_thisGridObj._search = _thisGridObj._search[_thisGridObj._search.length - 1], g = _thisGridObj._findNext(s.row, s.col)), g > -1 && (d = !0, o.select(g, s.col))
}
}
});
}
FlexGrid.prototype._findNext = function (e, t) {
var i = this,
o = i.rows.length;
(e < 0 || 1 == this._search.length) && e++;
for (var n = 0; n < o; n++) {
var r = (e + n) % o;
if (0 == i.getCellData(r, t, !0).trim().toLowerCase().indexOf(this._search)) return r
}
return -1
}
Added the following code to my existing wijmo library and it is working.