How to disable Save Handler on Jqgrid while doing editing

后端 未结 1 1705
太阳男子
太阳男子 2021-01-28 07:55

I am working on an ASP.net MVC 4.0 application with Jqgrid.

I am making all rows as editable with some columns being editable and some non editable.

相关标签:
1条回答
  • 2021-01-28 08:46

    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.

    0 讨论(0)
提交回复
热议问题