按钮的隐藏和显示
程序员文章站
2022-05-05 19:11:13
...
按钮颜色变灰
onCheckRow: function (e) {
var rows = resultGrid.getCheckedRows();
var approveStatus = rows[0]["approveStatus"];
//未提交、驳回时可以修改/删除,不能流程跟踪
if (approveStatus == "10") {
//未提交的时候,且记录创建人是本人的时候
$(".k-grid-FELLOW").attr("disabled", true);
$("#FELLOW").css("pointer-events", "none");
$(".k-grid-SUMIT").attr("disabled", false);
$("#SUMIT").css("pointer-events", "");
$(".k-grid-FELLOW").attr("disabled", true);
$("#FELLOW").css("pointer-events", "none");
$(".k-grid-UPDATE").attr("disabled", false);
$("#UPDATE").css("pointer-events", "");
$(".k-grid-REMOVE").attr("disabled", false);
$("#REMOVE").css("pointer-events", "");
}
//审批中
if (approveStatus != "10") {
$(".k-grid-UPDATE").attr("disabled", true);
$("#UPDATE").css("pointer-events", "none");
$(".k-grid-REMOVE").attr("disabled", true);
$("#REMOVE").css("pointer-events", "none");
$(".k-grid-SUMIT").attr("disabled", true);
$("#SUMIT").css("pointer-events", "none");
$(".k-grid-FELLOW").attr("disabled", false);
$("#FELLOW").css("pointer-events", "");
}
//驳回状态(只有“未提交”、“驳回”状态下的才可删除。)
if (approveStatus == "40") {
$(".k-grid-UPDATE").attr("disabled", false);
$("#UPDATE").css("pointer-events", "");
$(".k-grid-REMOVE").attr("disabled", false);
$("#REMOVE").css("pointer-events", "");
$(".k-grid-SUMIT").attr("disabled", true);
$("#SUMIT").css("pointer-events", "none");
$(".k-grid-FELLOW").attr("disabled", false);
$("#FELLOW").css("pointer-events", "");
}
},
按钮交替显示
//当我们的状态改为“驳回“时,审核按钮隐藏,重新发起按钮显示;
if (approveStatus == "40") {
$("#PASS").hide();
$("#SAVE").show();
}