jquery ui - Jqgrid - How to retain the hovered style when using context menu for a row -



jquery ui - Jqgrid - How to retain the hovered style when using context menu for a row -

in jqgrid when hover mouse on row highlights row. when utilize context enu, highlighted style gone row.

now users not aware row context menu opened for. know if can retain hovered style. know can setselect on grid selected row, don't want select row. in advance...

i suggest utilize mouseover , mouseleave (or jquery.hover event same) set ui-state-hover class on row on context menu opened. in way can prepare behavior standard

to following:

the demo demonstrate suggestion live. corresponding code included below:

$grid.contextmenu('mymenu1', { bindings: { edit: function (trigger, currenttarget) { $(trigger).jqgrid('editrow', $(currenttarget).closest("tr.jqgrow").attr('id'), true); }, del: function (trigger, currenttarget) { $(trigger).jqgrid('delgridrow', $(currenttarget).closest("tr.jqgrow").attr('id')); } }, menustyle: { backgroundcolor: '#fcfdfd', border: '1px solid #a6c9e2', maxwidth: '600px', width: '100%' }, itemhoverstyle: { border: '1px solid #79b7e7', color: '#1d5987', backgroundcolor: '#d0e5f5' }, onshowmenu: function (e, $menu) { var $row = $(e.target).closest('tr.jqgrow'); $menu.mouseover(function () { seek { $row.siblings().removeclass('ui-state-hover'); } grab (e) {} $row.addclass('ui-state-hover'); }).mouseleave(function (e) { var $rownew = $(e.target).closest('tr.jqgrow'); if ($rownew.attr('id') !== $row.attr('id')) { $row.removeclass('ui-state-hover'); } }); homecoming $menu; } });

jquery-ui jqgrid

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -