MWF.xDesktop.requireApp("Attendance", "Explorer", null, false); MWF.xDesktop.requireApp("Selector", "package", null, false); MWF.xApplication.Attendance.AbnormalExport = new Class({ Extends: MWF.xApplication.Attendance.Explorer, Implements: [Options, Events], initialize: function(node, app, actions, options){ this.setOptions(options); this.app = app; this.path = "../x_component_Attendance/$AbnormalExport/"; this.cssPath = "../x_component_Attendance/$AbnormalExport/"+this.options.style+"/css.wcss"; this._loadCss(); this.actions = actions; this.node = $(node); this.initData(); if (!this.personActions) this.personActions = new MWF.xAction.org.express.RestActions(); }, load: function(){ // this.loadToolbar(); this.loadFilter(); this.loadContentNode(); //this.loadView( filterData ); this.setNodeScroll(); }, loadFilter : function(){ this.fileterNode = new Element("div.fileterNode", { "styles": this.app.css.fileterNode }).inject(this.node); this.loadFilterStyle( function( css ) { this.filterFormCss = css; var table = new Element("table", { "width": "100%", "border": "0", "cellpadding": "5", "cellspacing": "0", "styles": this.app.css.filterTable, "class": "filterTable", "style": "width:300px;" }).inject(this.fileterNode); var tr = new Element("tr").inject(table); this.createYearSelectTd(tr); this.createMonthSelectTd(tr); this.createActionTd(tr); }.bind(this)) }, createYearSelectTd : function( tr ){ var _self = this; var td = new Element("td", { "styles" :this.app.css.filterTableTitle, "text" : this.app.lp.annuaal }).inject(tr); var td = new Element("td", { "styles" : this.app.css.filterTableValue }).inject(tr); this.yearString = new MDomItem( td, { "name" : "yearString", "type" : "select", "selectValue" : function(){ var years = []; var year = new Date().getFullYear(); for(var i=0; i<6; i++ ){ years.push( year-- ); } return years; } }, true, this.app, this.filterFormCss ); this.yearString.load(); }, createMonthSelectTd : function( tr ){ var _self = this; var td = new Element("td", { "styles" : this.app.css.filterTableTitle, "text" : this.app.lp.months }).inject(tr); var td = new Element("td", { "styles" : this.app.css.filterTableValue }).inject(tr); this.monthString = new MDomItem( td, { "name" : "monthString", "type" : "select", "selectValue" :["01","02","03","04","05","06","07","08","09","10","11","12"] }, true, this.app, this.filterFormCss ); this.monthString.load(); }, createActionTd : function( tr ){ var td = new Element("td", { "styles" : this.app.css.filterTableValue }).inject(tr); var input = new Element("button",{ "text" : this.app.lp.export, "styles" : this.app.css.filterButton }).inject(td); input.addClass("mainColor_bg"); input.addEvent("click", function(){ this.export(this.yearString.getValue(), this.monthString.getValue() ); //this.loadView( filterData ); }.bind(this)) }, setContentSize: function(){ var toolbarSize = this.toolbarNode ? this.toolbarNode.getSize() : {"x":0,"y":0}; var titlebarSize = this.app.titleBar ? this.app.titleBar.getSize() : {"x":0,"y":0}; var filterSize = this.fileterNode ? this.fileterNode.getSize() : {"x":0,"y":0}; var nodeSize = this.node.getSize(); var pt = this.elementContentNode.getStyle("padding-top").toFloat(); var pb = this.elementContentNode.getStyle("padding-bottom").toFloat(); //var filterSize = this.filterNode.getSize(); var filterConditionSize = this.filterConditionNode ? this.filterConditionNode.getSize() : {"x":0,"y":0}; var height = nodeSize.y-toolbarSize.y-pt-pb-filterConditionSize.y-titlebarSize.y-filterSize.y; this.elementContentNode.setStyle("height", ""+height+"px"); this.pageCount = (height/30).toInt()+5; if (this.view && this.view.items.length