74 lines
2.5 KiB
JavaScript
74 lines
2.5 KiB
JavaScript
var SysApcOverview = (function() {
|
|
|
|
function SysApcOverview(){
|
|
var _this = this;
|
|
|
|
_this.oTable = new CTable("data");
|
|
_this.oTable.loadTableData();
|
|
}
|
|
|
|
// Rewrite CTable object callback
|
|
CTable.prototype.tableObjectCallback = function(oTable){
|
|
var _this = this;
|
|
oTable.find("#idisable, #ienable").click(function(){
|
|
_this.sendAjaxAction($(this).attr("id"), {force : 1}, function(d){
|
|
if(d && $.isDefined(d.jsonok)){
|
|
_this.filterTableData(true);
|
|
if($.isDefined(d.lbl))
|
|
$(".cnt-shadow .search h2 .status span").html(d.lbl);
|
|
}
|
|
});
|
|
});
|
|
|
|
oTable.find("#icleartable").click(function(){
|
|
|
|
CBase.oDialog.show({
|
|
closeBtn: true,
|
|
title : $.isDefined(CBase.gM.clearTitle)?CBase.gM.clearTitle:"...",
|
|
message :$.isDefined(CBase.gM.clearMessage)?CBase.gM.clearMessage:"-",
|
|
buttons : {
|
|
1 : {
|
|
lbl : $.isDefined(CBase.gM.clearYes)?CBase.gM.clearYes:"Ok",
|
|
id : "buttonYes",
|
|
click : function(){
|
|
CBase.oDialog.hide();
|
|
_this.sendAjaxAction("clearAll", {force : 1}, function(d){
|
|
if(d && $.isDefined(d.jsonok))
|
|
_this.filterTableData(true);
|
|
});
|
|
}
|
|
},
|
|
2 : {
|
|
lbl :$.isDefined(CBase.gM.clearCancel)?CBase.gM.clearCancel:"Cancel",
|
|
id : "buttonNo",
|
|
click : function(){
|
|
CBase.oDialog.hide();
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
});
|
|
};
|
|
|
|
// Rewrite CBase form callback
|
|
CBlank.prototype.viewCallback = function(obj){
|
|
var _this = this;
|
|
|
|
obj.find(".data table tr:odd").addClass("odd");
|
|
obj.find(".data table tr:last").addClass("last");
|
|
|
|
this.oBtnPan.find("#fcancel").click(function(){
|
|
CBase.message.hide();
|
|
if(_this.isModiffied){
|
|
CBase.oTable.filterTableData(true);
|
|
}else{
|
|
CBase.oTable.show();
|
|
}
|
|
});
|
|
|
|
this.bindBlankActions(obj);
|
|
};
|
|
|
|
return SysApcOverview;
|
|
})(); |