VecDefGrid.js 2.1 KB
Ext.define('treps.view.Steps.TransformationDefinition.VecDefGrid' ,{
        extend: 'Ext.grid.Panel',

        alias: 'widget.vecdef_grid',

	title: 'Vectors Definition',

	colRenderer: Ext.emptyFn,

	controllers: [
		'Vectors.VecDefGrid'
	],

        initComponent: function() {
                this.callParent(arguments);
        },

	tools: [
		{
			type: 'help',
			pageId: 'vectors'
		}
	],

        /*layout: {
                type: 'fit',
                padding: 5,
                margin: 5
        },*/

	autoScroll: true,

	columns: [
                {
                        header: 'Comp. 1',
			tooltip: 'First vector component',
			dataIndex: 'comp_1',
			renderer: function (value, metaData, record, row, col, store, gridView)
				{
					if (this.colRenderer)
						return this.colRenderer(value, metaData, record, row, col, store, gridView);
					else
						return value;
				},
			flex: 2
                },
		{
			header: 'Comp. 2',
			tooltip: 'Second vector component',
			dataIndex: 'comp_2',
                        renderer: function (value, metaData, record, row, col, store, gridView)
				{
					if (this.colRenderer)
						return this.colRenderer(value, metaData, record, row, col, store, gridView);
					else
						return value;
				},
			flex: 2
		},
		{
			header: 'Comp. 3',
			tooltip: 'Third vector component',
			dataIndex: 'comp_3',
                        renderer: function (value, metaData, record, row, col, store, gridView)
				{
					if (this.colRenderer)
						return this.colRenderer(value, metaData, record, row, col, store, gridView);
					else
						return value;
				},
			flex: 2
		},
		{
			xtype : 'checkcolumn',
			header: 'Pos.',
			tooltip: 'When this column is checked, the vector represents a position (km) in space.',
			dataIndex: 'is_pos',
			flex: 1
		}
        ],

	tbar: [
		{
			xtype: 'button',
			id: 'addVecButton',
			text: 'Add',
			iconCls: 'icons-16x16-add'
		},
		{
			xtype: 'button',
			id: 'removeVecButton',
			text: 'Remove',
			iconCls: 'icons-16x16-remove'
		},
		{
			xtype: 'button',
			id: 'editVecButton',
			text: 'Edit',
			iconCls: 'icons-16x16-edit'
		}
	]
});