How to disable Save Handler on Jqgrid while doing editing

孤街醉人 提交于 2019-12-02 09:18:47
Sai Avinash

I Solved it in this way:

Dont know whether it is right way of doing this:

Oleg..i need your views on this:

    if(cnt > 0) {
        svr.id = rowid; $t.p.savedRow.push(svr);
        $(ind).attr("editable","1");
        $("td:eq("+focus+") input",ind).focus();
        if(o.keys===true) {
            $(ind).bind("keydown",function(e) {
                if (e.keyCode === 27) {
//                  debugger
//                  $($t).jqGrid("restoreRow",rowid, o.afterrestorefunc);
//                  if($t.p._inlinenav) {
//                     try {
//                        $($t).jqGrid('showAddEditButtons');
//                     } 
//                     catch (eer1) {}
//                  }
                    return false;
                }
                if (e.keyCode === 13) {
//                  var ta = e.target;
//                  if(ta.tagName === 'TEXTAREA') { return true; }
//                  if( $($t).jqGrid("saveRow", rowid, o ) ) {
//                      if($t.p._inlinenav) {
//                          try {
//                              $($t).jqGrid('showAddEditButtons');
//                          } catch (eer2) {}
//                      }
//                  }
                    return false;
                }
            });
        }
        $($t).triggerHandler("jqGridInlineEditRow", [rowid, o]);
        if( $.isFunction(o.oneditfunc)) { o.oneditfunc.call($t, rowid); }
    }

This is the code , i found in the Jqgrid.src.js

Since, i done need restoreRow and saveRow to be called when Enter key or ESC is pressed, i commented out the code .

I dont know if it is right way to do it. but, this worked indeed for my Scenario.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!