/*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if(!dojo._hasResource["kfc.kwo.InfoGrid"]){dojo._hasResource["kfc.kwo.InfoGrid"]=true;dojo.provide("kfc.kwo.InfoGrid");dojo.require("dijit.form.Button");dojo.require("kfc.util.Toolbar");dojo.require("kfc.kwo._Info");dojo.require("kfc.kwo._GridBase");dojo.require("kfc.form.MultiPopupTextBox");dojo.declare("kfc.kwo.InfoGrid",[kfc.kwo._Info,kfc.kwo._GridBase],{templateString:dojo.cache("kfc.kwo","templates/InfoGrid.html","
\n \n
\n
\n \n \n \n \n \n
\n
\n
\n
\n
\n
\n \n\n
\n
\n
\n"),widgetsInTemplate:true,constructor:function(){},baseRowNum:10,rowNumInc:10,showPrintColumn:false,_getGridStructure:function(){var _1=[{name:" ",field:"",formatter:function(){return " ";},editable:false,width:"1em"},{name:"Line #",field:"P_LINE_NO",editable:true,width:"6em"},{name:"Description",field:"P_TEXT",editable:true,width:"auto"}];if(this.showPrintColumn){_1.push({name:"Print",field:"P_PRINT_FLAG",width:"6em",editable:true,type:dojox.grid.cells.Select,options:["Y","N"]});}return _1;},renumberRows:function(){var _2=this.f_grid.rowCount;var _3=this.f_grid.store;var _4=this.baseRowNum;var _5=this.rowNumInc;for(var i=0;i<_2;i++){var _6=this.f_grid.getItem(i);_3.setValue(_6,"P_LINE_NO",_4);_4+=_5;}},openCopyMPTB:function(){this.copyMPTB.openFindWin();},addCopiedInfo:function(_7,_8){for(var i in _8){var _9={};for(var j in _8[i]){if(j!="_S"&&j!="_RI"&&j!="_0"){_9[j]=_8[i][j][0];}}this._newData(_9);}},_customGetRemoteQuery:function(q){return {P_TABLE_NAME:"KWO_INFO",P_VALUES:dojo.toJson(q)};},addHiddenParams:function(){this.copyMPTB.addDefaultFormVal("P_SOURCE_LOOKUP_ID",this.P_SOURCE_LOOKUP_ID);this.copyMPTB.addDefaultFormVal("P_SOURCE_LOOKUP_VALUE_ID",this.P_SOURCE_LOOKUP_VALUE_ID);this.copyMPTB.addDefaultFormVal("P_LOOKUP_ID",this.P_LOOKUP_ID);this.copyMPTB.addDefaultFormVal("P_LOOKUP_VALUE_ID",this.P_LOOKUP_VALUE_ID);this.copyMPTB.addDefaultFormVal("P_DELETED_FLAG","N");this.copyMPTB.seedFormVals();},configureCopyMPTB:function(_a,_b,_c,_d){_c=(typeof _c!="undefined")?_c:null;_d=(typeof _d!="undefined")?_d:"P_TEXT";this.copyMPTB.attr("storeFile",_a);this.copyMPTB.valueField=_d;if(_c){this.copyMPTB.gStructure=_c;}if(_b.length>0){for(var i=0;i<_b.length;i++){this.copyMPTB.paramMap.push(_b[i]);}this.copyMPTB.attr("paramMap",this.copyMPTB.paramMap);}},postCreate:function(){this.inherited(arguments);dojo.connect(this.copyMPTB,"onOk",this,"addCopiedInfo");dojo.connect(this.copyMPTB,"resetParams",this,"addHiddenParams");this.copyMPTB.getRemoteQuery=this._customGetRemoteQuery;if(!this.allowEdit){this.toolbar.disableToolbar(true);}}});}