laurenceputra laurenceputra - 10 months ago 97
jQuery Question

jqGrid: how to lose focus when i click outside the grid, or anywhere else for that matter

i'm currently doing editing using inline editing, and when i click outside the grid, it's still being under edit. what event handlers should i use to make it call the restore row function, such that the only way for data to actually sent to the server is if the user presses enter.

thx in advance


Anyway, i've figured out how to do it already. Just thought might be good to leave it somewhere online as I wasted quite a bit of time figuring out how to do it. Hope it helps =)

    if( != lastSelectRoot+"_FieldName"){
        lastSelectRoot = null;

Just add this piece of code somewhere and change the appropriate parts, such as FieldName and lastSelectRoot and #grid to what you are already using.