Ext.define('Portfolio.designer.ui.EditcodeComboBox', {

	extend: "Ext.form.field.ComboBox",

	alias: [
		'widget.ip2EditcodeComboBox'
	],

	displayField: 'editcode',

	valueField: 'editcode',

	emptyText: '',

	matchFieldWidth: false,

	alternateClassName: [
		"ip2EditcodeComboBox"
	],

	initComponent: function() {
		var me = this;

		var tpl = '<table border="1">'
		+ '<tpl for=".">'
		+ '<tr class="x-boundlist-item ip2-editcode-boundlist-firstRow{editcode}">'
		+ '<td class="ip2-editcode-boundlist-cell">{editcode}</td>'
		+ '<td class="ip2-editcode-boundlist-cell">{comma}</td>'
		+ '<td class="ip2-editcode-boundlist-cell">{decimal}</td>'
		+ '<td class="ip2-editcode-boundlist-cell">{sign}</td>'
		+ '<td class="ip2-editcode-boundlist-cell">{blank}</td>'
		+ '<td class="ip2-editcode-boundlist-cell">{iValue}</td>'
		+ '<td class="ip2-editcode-boundlist-cell">{jValue}</td>'
		+ '<td class="ip2-editcode-boundlist-cell">{zero}</td>'
		+ '</tr>'
		+ '</tpl>'
		+ '</table>';

		me.listConfig = {
			tpl: tpl,itemSelector: '.x-boundlist-item',width: 810
		};

		var i_store = Ext.create('Ext.data.Store', {
			fields: [
				{ name: 'key', type: 'string' },
				{ name: 'comma', type: 'string' },
				{ name: 'decimal', type: 'string' },
				{ name: 'sign', type: 'string' },
				{ name: 'sign', type: 'string' },
				{ name: 'blank', type: 'string' },
				{ name: 'iValue', type: 'string' },
				{ name: 'jValue', type: 'string' },
				{ name: 'zero', type: 'string' }
			],
			data: [
				{
					editcode: "",
					comma: "Commas Displayed",
					decimal: "Decimal Points Displayed",
					sign: "Sign Displayed When Negative Value",
					blank: "Blank Value of QDECFMT System Value",
					iValue: "I Value of QDECFMT System Value",
					jValue: "J Value of QDECFMT System Value",
					zero: "Leading Zero Suppressed"
				},
				{
					editcode: "1",
					comma: "Yes",
					decimal: "Yes",
					sign: "No sign",
					blank: ".00 or 0",
					iValue: ",00 or 0",
					jValue: "0,00 or 0",
					zero: "Yes"
				},
				{
					editcode: "2",
					comma: "Yes",
					decimal: "Yes",
					sign: "No sign",
					blank: "Blanks",
					iValue: "Blanks",
					jValue: "Blanks",
					zero: "Yes"
				},
				{
					editcode: "3",
					comma: "",
					decimal: "Yes",
					sign: "No sign",
					blank: ".00 or 0",
					iValue: ",00 or 0",
					jValue: "0,00 or 0",
					zero: "Yes"
				},
				{
					editcode: "4",
					comma: "",
					decimal: "Yes",
					sign: "No sign",
					blank: "Blanks",
					iValue: ",Blanks",
					jValue: "Blanks",
					zero: "Yes"
				},
				{
					editcode: "A",
					comma: "Yes",
					decimal: "Yes",
					sign: "CR",
					blank: ".00 or 0",
					iValue: ",00 or 0",
					jValue: "0,00 or 0",
					zero: "Yes"
				},
				{
					editcode: "B",
					comma: "Yes",
					decimal: "Yes",
					sign: "CR",
					blank: "Blanks",
					iValue: ",Blanks",
					jValue: "Blanks",
					zero: "Yes"
				},
				{
					editcode: "C",
					comma: "",
					decimal: "Yes",
					sign: "CR",
					blank: ".00 or 0",
					iValue: ",00 or 0",
					jValue: "0,00 or 0",
					zero: "Yes"
				},
				{
					editcode: "D",
					comma: "",
					decimal: "Yes",
					sign: "CR",
					blank: "Blanks",
					iValue: ",Blanks",
					jValue: "Blanks",
					zero: "Yes"
				},
				{
					editcode: "J",
					comma: "Yes",
					decimal: "Yes",
					sign: "-(Minus)",
					blank: ".00 or 0",
					iValue: ",00 or 0",
					jValue: "0,00 or 0",
					zero: "Yes"
				},
				{
					editcode: "K",
					comma: "Yes",
					decimal: "Yes",
					sign: "-(Minus)",
					blank: "Blanks",
					iValue: ",Blanks",
					jValue: "Blanks",
					zero: "Yes"
				},
				{
					editcode: "L",
					comma: "",
					decimal: "Yes",
					sign: "-(Minus)",
					blank: ".00 or 0",
					iValue: ",00 or 0",
					jValue: "0,00 or 0",
					zero: "Yes"
				},
				{
					editcode: "M",
					comma: "",
					decimal: "Yes",
					sign: "-(Minus)",
					blank: "Blanks",
					iValue: ",Blanks",
					jValue: "Blanks",
					zero: "Yes"
				},
				{
					editcode: "N",
					comma: "Yes",
					decimal: "Yes",
					sign: "-(Minus)",
					blank: ".00 or 0",
					iValue: ",00 or 0",
					jValue: "0,00 or 0",
					zero: "Yes"
				},
				{
					editcode: "O",
					comma: "Yes",
					decimal: "Yes",
					sign: "-(Minus)",
					blank: "Blanks",
					iValue: ",Blanks",
					jValue: "Blanks",
					zero: "Yes"
				},
				{
					editcode: "P",
					comma: "",
					decimal: "Yes",
					sign: "-(Minus)",
					blank: ".00 or 0",
					iValue: ",00 or 0",
					jValue: "0,00 or 0",
					zero: "Yes"
				},
				{
					editcode: "Q",
					comma: "",
					decimal: "Yes",
					sign: "-(Minus)",
					blank: "Blanks",
					iValue: ",Blanks",
					jValue: "Blanks",
					zero: "Yes"
				},
				{
					editcode: "W",
					comma: "",
					decimal: "",
					sign: "",
					blank: "",
					iValue: "",
					jValue: "",
					zero: "Yes"
				},
				{
					editcode: "Y",
					comma: "",
					decimal: "",
					sign: "",
					blank: "",
					iValue: "",
					jValue: "",
					zero: "Yes"
				},
				{
					editcode: "Z",
					comma: "",
					decimal: "",
					sign: "",
					blank: "",
					iValue: "",
					jValue: "",
					zero: "Yes"
				}
			]
		});

		me.store = i_store;

		me.callParent();
	}
})
