var isSaveFmtOtherDesign=false;var eidtorOtherGridObject=undefined;var eidtorOtherGridIndex=undefined;var toolbarOther=[{text:"新增",iconCls:"e-icon fa fa-plus",handler:function(){addFormatDesignOtherGridRow()}},"-",{text:"删除",iconCls:"e-icon fa fa-remove",handler:function(){removeitEidtorOtherGridRow()}},"-",{text:"上移",iconCls:"e-icon fa fa-arrow-up",handler:function(){moveUpEidtorOtherGridRow()}},"-",{text:"下移",iconCls:"e-icon fa fa-arrow-down",handler:function(){moveDownEidtorOtherGridRow()}}];function moveUpEidtorOtherGridRow(){myOtherGridSortRow("up")}function moveDownEidtorOtherGridRow(){myOtherGridSortRow("down")}function myOtherGridSortRow(c){if(endEidtorOtherGridEditing()){eidtorOtherGridObject.datagrid("acceptChanges")}var d=eidtorOtherGridObject.datagrid("getRows");var a=d.length;var b=eidtorOtherGridObject.datagrid("getSelected");var e=eidtorOtherGridObject.datagrid("getRowIndex",b);if(c=="up"){if(e==0){$.messager.alert("提示","顶行无法上移!","warning")}else{eidtorOtherGridObject.datagrid("deleteRow",e);e--;eidtorOtherGridObject.datagrid("insertRow",{index:e,row:b});eidtorOtherGridObject.datagrid("selectRow",e)}}else{if(c=="down"){if(e==a-1){$.messager.alert("提示","底行无法下移!","warning")}else{eidtorOtherGridObject.datagrid("deleteRow",e);e++;eidtorOtherGridObject.datagrid("insertRow",{index:e,row:b});eidtorOtherGridObject.datagrid("selectRow",e)}}}}function addFormatDesignOtherGridRow(){var a={};appendEidtorOtherGridRow(a)}function onClickOtherEditorRow(a,b){isSaveFmtOtherDesign=true;if(eidtorOtherGridIndex!=a){if(endEidtorOtherGridEditing()){eidtorOtherGridObject.datagrid("selectRow",a).datagrid("beginEdit",a);eidtorOtherGridIndex=a}else{eidtorOtherGridObject.datagrid("selectRow",eidtorOtherGridIndex)}}}function endEidtorOtherGridEditing(){if(eidtorOtherGridIndex==undefined){return true}if(eidtorOtherGridObject.datagrid("validateRow",eidtorOtherGridIndex)){handlerEidtorOtherGrid();eidtorOtherGridObject.datagrid("endEdit",eidtorOtherGridIndex);eidtorOtherGridIndex=undefined;return true}else{return false}}function acceptEidtorOtherGrid(){isSaveFmtOtherDesign=false;if(endEidtorOtherGridEditing()){eidtorOtherGridObject.datagrid("acceptChanges")}}function appendEidtorOtherGridRow(b,a){isSaveFmtOtherDesign=true;if(endEidtorOtherGridEditing()){eidtorOtherGridObject.datagrid("appendRow",b);eidtorOtherGridIndex=eidtorOtherGridObject.datagrid("getRows").length-1;eidtorOtherGridObject.datagrid("selectRow",eidtorOtherGridIndex).datagrid("beginEdit",eidtorOtherGridIndex);if(!a){appendRestulOtherFun()}}}function appendRestulOtherFun(){var a=eidtorOtherGridObject.datagrid("getRows")}function removeitEidtorOtherGridRow(){if(eidtorOtherGridIndex==undefined){return}eidtorOtherGridObject.datagrid("cancelEdit",eidtorOtherGridIndex).datagrid("deleteRow",eidtorOtherGridIndex);eidtorOtherGridIndex=undefined}function rejectEidtorOtherGrid(){if(endEidtorOtherGridEditing()){eidtorOtherGridObject.datagrid("rejectChanges")}}function getEidtorOtherGridChanges(){var a=eidtorOtherGridObject.datagrid("getChanges");console.log(a)}function handlerEidtorOtherGrid(){}function addFormatOtherDesignMessage(){if(isSaveFmtOtherDesign){$.messager.confirm("提示消息","您有修改过的数据未保存,您确定要执行当前操作吗?",function(a){if(a){addFormatDesignRecord();isSaveFmtOtherDesign=false}})}else{addFormatDesignRecord()}};