var IsEnable = [{ id: 0, text: '启用' }, { id: 1, text: '禁用'}];
function onGenderRenderer(e) {
for (var i = 0, l = IsEnable.length; i < l; i++) {
var g = IsEnable;
if (g.id == e.value) return g.text;
}
return "";
}
function saveData() {
var data = grid.getChanges();
var json = mini.encode(data);
function onCellValidation(e) {
if (e.field == "End_Date") {
if (e.value == 0) {
e.isValid = false;
e.errorText = "不能为空";
}
}
}
if (grid != undefined) {
grid.on("drawcell", function (e) {
var record = e.record,
column = e.column,
field = e.field,
value = e.value;
if (column.name == "state") {
if (e.value == 0) {
e.cellHtml = ""
}
else if (e.value == 1) {
e.cellHtml = "<span class=\"icon-no\" onclick=\"edit('" + field + "')\"></span>"
}
else {
e.cellHtml = "<span class=\"icon-ok\" onclick=\"edit('" + field + "')\"></span>"
}
}
});
}
function edit(sup_id) {
var row = grid.getSelected();
if (row) {
mini.open({
url: "PM_Proj_Task_Edit_Prod.html",
title: "供应商任务审核", width: 950, height: 450,
onload: function () {
var iframe = this.getIFrameEl();
var data = { action: "edit", sup_id: sup_id, id: row.id };
iframe.contentWindow.SetData(data);
},
ondestroy: function (action) {
grid.reload();
}
});
} else {
alert("请选中一条记录");
}
}