javascript - How to allow go to specified page in free jqgrid pager -
free jqgrid has page number field. entering page number , pressing enter shold invoke specified table. stopped work @ time. remote json data used. entering page number , pressing enter nothing.
i added alert(key);
jqgrid source code shown in code below before line
https://github.com/free-jqgrid/jqgrid/blob/master/js/jquery.jqgrid.src.js#l4045
if enter pressed, alert box not appear. if other keys pressed, alert box appears.
how fix ? how find reason why enter ignored. maybe other method captures enter key , cancels event not passed handler. how find ?
if (p.pginput === true) { $("input.ui-pg-input", pgcnt).bind("keypress.jqgrid", function (e) { var key = e.charcode || e.keycode || 0, newpage = intnum($(this).val(), 1); alert(key); // added if (key === 13) { if (!clearvals("user", newpage, intnum(p.rownum, 10))) { return false; } $(this).val(newpage); p.page = ($(this).val() > 0) ? $(this).val() : p.page; populate.call(ts); return false; } return this; }); }
update
chrome developer tools shows following listeners. how find blocks enter key ?
i suppose problem exist not in free jqgrid. guess other handle of keydown
registered returns false
(or in other way e.preventdefault()
), prevent processing of other keydown
and processing of <kbd>enter</kbd>
key. sure 1 has debug registered keydown
, keydown
handlers.
updated: suppose move pager input field inside of navigator bar (as remember old questions). result enter in pager input replaced click
.
$focused = $(this).find(":focus"); if ($focused.length > 0) { $focused.trigger("click"); return false; }
the problem not exist in standard navigator bar. exist after customization of navigator bar. nevertheless posted today the changes modifies line $focused = $(this).find(":focus");
to
$focused = $(this).find(".ui-pg-button").filter(":focus");
it makes no effects in standard navigator of free jqgrid, can solve problem exists after customization of navigator bar.
Comments
Post a Comment