//****************************************************************************************// //**********************************EasyUI函数扩展****************************************// $.fn.extend({ cmsPanel: function (obj) { var target = $(this); var newObj; if (typeof (obj) == "object" && obj.href) { newObj = $.extend({}, obj); var newUrl = ("/" + CMS_SystemConfig.VirtualDirectoryPath + obj.href.replace(CMS_SystemConfig.VirtualDirectoryPath, "")).replaceDoubleSlashesToSingle(); newObj.href = newUrl; } else { newObj = obj; } return target.panel(newObj); }, cmsDialog: function (obj) { var target = $(this); var newObj; if (typeof (obj) == "object" && obj.href) { newObj = $.extend({}, obj); var newUrl = ("/" + CMS_SystemConfig.VirtualDirectoryPath + obj.href.replace(CMS_SystemConfig.VirtualDirectoryPath, "")).replaceDoubleSlashesToSingle(); newObj.href = newUrl; } else { newObj = obj; } return target.dialog(newObj); }, getDataGridRowIndex: function (o) { var p = $(o); while (p && p.size() > 0) { if (p.attr("datagrid-row-index")) { return parseInt(p.attr("datagrid-row-index")); } else if (p.attr("node-id")) { return p.attr("node-id"); } p = p.parent(); } return -1; }, disable: function () {//禁用控件,用法$(**).disable(); this.each(function () { var _this = $(this); _this.attr({ "disabled": "disabled" }); _this.addClass("disabled"); _this.removeClass("validatebox-invalid"); }); }, enable: function () {//启用控件,用法$(**).enable(); this.each(function () { var _this = $(this); _this.removeAttr("disabled"); _this.removeClass("disabled"); }); } }); $.messager.CloseProgress = function () { /// /// 关闭$.messager.progress进度条 /// var win = $("div.messager-progress").closest("div.messager-body"); if (win.length) { win.window("close"); } } //******************************************End******************************************// //***************************************************************************************//