function insertPlsf(){
var $plsfList = $("#plsfList") ;
var $operate = $("#operate").val();
//设置grid单元格可编辑
$plsfList.setGridParam({cellEdit:true});
//设置grid行不可编辑
//$plsfList.jqGrid('editRow', newrowid, false);
//拼接请求的url
var url = '<%=basePath%>'+"/lfc/powerlsfactor/save" ;
var $params = $plsfList.find("input[id^="+newrowid+"]");
var $check_val = $params.eq(0).is(':checked') ? 1:0;
url = addParamToUrl(url,'valid',$check_val);
url = addParamToUrl(url,'zoneID',$("#zone_id").val());
url = addParamToUrl(url,'factorPG',$params.eq(2).val());
url = addParamToUrl(url,'factorQG',$params.eq(3).val());
url = addParamToUrl(url,'factorPL',$params.eq(4).val());
url = addParamToUrl(url,'factorQL',$params.eq(5).val());
var $caseID = $("#caseID").val();
url = addParamToUrl(url,'caseID',$caseID);
$.ajax({url:url,type:"post",timeout:5000,
success:function(data){
showMessage(data);
reloadGrid();
}
});
//将新添加行号 初始为空
newrowid = '' ;
//确定按钮不可用
$("#confirm_btn").attr("disabled",true);
}
//格式zone列输出内容
function formatZone(cellvalue, options, rowObject){
if(cellvalue == 0){
return 0;
}else if(cellvalue == 1){
return 1;
}else if(cellvalue == 2){
return 2;
}else{
return 3;
}
}
function isRowNeedSave($jqgrid){
var $editTr = $jqgrid.find("tr[editable=1]") ;
var flag = false ;
if ( $editTr && $editTr.length > 0){
flag = true ;
}
return flag ;
}
function cancel(){
reloadGrid();
//确定按钮不可用
$("#confirm_btn").attr("disabled",true);
//设置grid单元格可编辑
$("#plsfList").setGridParam({cellEdit:true});
//设置grid单元格可编辑
$('#plsfList').jqGrid('editRow', newrowid, true);
}
function fnCallDialogForEidt(){
//获得当前行号(数据编号)
var returnValue = "";
returnValue = window.showModalDialog("<c:url value='/element/zone/query?caseID="+$("#caseID").val()+"' />",window,"");
if(returnValue==""||returnValue==null)
return;
var $plsfList = $("#plsfList");
var $params = $plsfList.find("input[id$='zoneName']");
var names = returnValue.split(",");
$params.eq(0).val(names[1]);
$("#zone_id").val(names[0]);
}