/*
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.InsuranceGrid"]){dojo._hasResource["kfc.kwo.InsuranceGrid"]=true;dojo.provide("kfc.kwo.InsuranceGrid");dojo.require("kfc.kwo._Insurance");dojo.require("kfc.kwo._GridBase");dojo.require("kfc.form.CurrencyTextBox");dojo.require("kfc.form.NumberTextBox");dojo.require("kfc.form.PopupTextBox");dojo.require("kfc.grid.PopupTextBoxCell");dojo.require("kfc.grid.CurrencyTextBoxCell");dojo.declare("kfc.kwo.InsuranceGrid",[kfc.kwo._Insurance,kfc.kwo._GridBase],{templateString:dojo.cache("kfc.kwo","templates/InsuranceGrid.html","
\n
\n\n
\n\n \n\n\n
\n
\n
\n"),widgetsInTemplate:true,assetFile:"server/getAssetInsurance.php",valueFile:"server/getLookupValues.php?P_NAME=INSURANCE_CODE",locationFile:"server/getLocation.php",categoryFile:"server/getCategory.php",_getGridStructure:function(){var _1=this;return [{name:" ",field:"",formatter:function(){return " ";},editable:false,width:"0px"},{name:"Asset #",field:"P_ASSET_NO",editable:false,width:"auto"},{name:"Year",field:"P_YEAR",editable:true,width:"auto"},{name:"Insurance Code",field:"P_INSURANCE_CODE_ID",editable:true,width:"auto",type:kfc.grid.PopupTextBoxCell,widgetProps:{valueField:"P_ID",displayField:"P_CODE",labelField:"P_VALUE",storeFile:this.valueFile,localSearch:true,searchOnOpen:true,seedSearchOnOpen:true,createGridOnInit:false,searchSeeds:["P_CODE"],verifyOnChange:true,tWidth:"80px",gStructure:[{name:"Code",field:"P_CODE",width:"100px"},{name:"Value",field:"P_VALUE",width:"200px"},{name:"Description",field:"P_DESCRIPTION",width:"200px"}],paramMap:[{name:"P_CODE",label:"Code"},{name:"P_VALUE",label:"Value"},{name:"P_DESCRIPTION",label:"Description"}]}},{name:"Purchased Price",field:"P_PURCHASED_PRICE",type:kfc.grid.CurrencyTextBoxCell,editable:true,width:"auto"},{name:"Installed Price",field:"P_INSTALLED_PRICE",type:kfc.grid.CurrencyTextBoxCell,editable:true,width:"auto"},{name:"Assessment Value",field:"P_ASSESSMENT_VALUE",type:kfc.grid.CurrencyTextBoxCell,editable:true,width:"auto"},{name:"Replacement Value",field:"P_REPLACEMENT_VALUE",type:kfc.grid.CurrencyTextBoxCell,editable:true,width:"auto"},{name:"Insurance Factor",field:"P_INSURANCE_FACTOR",widgetClass:kfc.form.NumberTextBox,editable:true,width:"auto"},{name:"Sound Factor",field:"P_SOUND_FACTOR",widgetClass:kfc.form.NumberTextBox,editable:true,width:"auto"}];},_loadData:function(x){this.inherited(arguments);},doSearch:function(){var v=this.f_form.attr("value");v.P_ACCESS_FLAG="Y";dojo.xhrPost({sync:true,url:this.assetFile,handleAs:"json",content:dojo.toJson(v),load:dojo.hitch(this,"_loadData"),error:dojo.hitch(this,"throwError")});},setStatus:function(_2){},postCreate:function(){this.inherited(arguments);this.i_location.storeFile=this.locationFile;this.i_category.storeFile=this.categoryFile;dojo.ready(dojo.hitch(this,"refreshGrid"));}});}