누구나 비슷한 질문이있는 경우.
나는 내 자신의 포맷터를 굴리기 시작했다. 행 인해 추가되는 저장 한 후 isSavedRow이 포맷터의 경우 사실로 전달되는
inlineNavAction = function(cellvalue, options, rowObject, isSavedRow){
if(isSavedRow !== true){
var rowid = options.rowId;
var ocl = "id='jSaveButton_"+rowid+"' onclick=jQuery.fn.fmatter.rowactions.call(this,'save'); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover'); ";
var str = "<div title='"+$.jgrid.edit.bSubmit+"' style='float:left;' class='ui-pg-div ui-inline-save' "+ocl+"><span class='ui-icon ui-icon-disk'></span></div>";
ocl = "id='jCancelButton_"+rowid+"' onclick=jQuery.fn.fmatter.rowactions.call(this,'cancel'); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover'); ";
str += "<div title='"+$.jgrid.edit.bCancel+"' style='float:left;margin-left:5px;' class='ui-pg-div ui-inline-cancel' "+ocl+"><span class='ui-icon ui-icon-cancel'></span></div>";
return "<div style='margin-left:8px;'>" + str + "</div>";
}else{
return $.fn.fmatter.actions(cellvalue, options, rowObject);
}
}
다시 호출되고. 또한 rowId의 기본값은 0입니다. 기본 조작에 대해 false를 전달하십시오. 저장과 버전에 대한 GitHub의에서 사용할 수있는 소스로부터 취소에 대한 나는 마크 업을했다 4.5
사용법 :
formatter: function(cellvalue,options,rowObject) {
return inlineNavAction(cellvalue,options,rowObject, (options.rowId!='new_row'));
}
(options.rowId!='new_row')
의 NEW_ROW는 기본 ROWID로 설정 한대로입니다 행이 추가되었습니다. new_row가 기본값입니다.
formatter: function (cellvalue, options, rowObject) {
if (cellvalue === undefined && options.rowId === "_empty") {
// remove edit and del buttons
options.colModel.formatoptions.editbutton = false;
options.colModel.formatoptions.delbutton = false;
}
return $.fn.fmatter.actions(cellvalue, options, rowObject);
},
다음 inlineNav
의 addParams
에서 우리는이 :