js

Ext.Loader.setConfig({enabled: true});
Ext.Loader.setConfig({disableCaching: false});
Ext.Loader.setPath('Ext.ux', window.WEBROOT + '/ext4/ux');
Ext.require([
     'Ext.window.*'
     ,'Ext.tab.*'
     ,'Ext.toolbar.Toolbar'
     ,'Ext.form.*'
     ,'Ext.slider.*'
     ,'Ext.panel.Panel'
     ,'Ext.ux.form.ItemSelector'
]);

var ds = Ext.create('Ext.data.ArrayStore', {
    data: [[123,'One Hundred Twenty Three'],
        ['1', 'One'], ['2', 'Two'], ['3', 'Three'], ['4', 'Four'], ['5', 'Five'],
        ['6', 'Six'], ['7', 'Seven'], ['8', 'Eight'], ['9', 'Nine']],
    fields: ['value','text'],
    sortInfo: {
        field: 'value',
        direction: 'ASC'
    }
});

Ext.onReady(function () {
	Ext.QuickTips.init();
	init();
});

function init(){	
	window.mainWindow = Ext.create('Ext.Window', {
        title: '配置',
        width: 520,
        height: 440,
        x:10,
        y:20,
        plain: true,
        headerPosition: 'top',
        layout: 'fit'
		,tools:[
		    {type:'refresh',tooltip: 'Refresh form Data',handler: function(event, toolEl, panel){
		    	refresh();
		    }},
		    {type:'help',tooltip: 'Get Help',handler: function(event, toolEl, panel){}}
		]
		,iconCls:'icon_config'
		,bodyStyle :'border-width : 0px'
    });
	
	var tabpanel = Ext.create('Ext.TabPanel',{
		resizeTabs: true,
        enableTabScroll: true,
        defaults: {
            autoScroll:true
            ,layout:'fit'
        },
  		items:[
			createForm()
			,{title: '统计字段值',html: 'content'}
			,{title: '多字段值相同',html: 'content'}
			,{title: '匹配关键字',html: 'content'}
			,{title: '编码模式',html: 'content'}
  		]
  		,plain: false
  		,bodyStyle :'border-width : 0px'
	});
	
	var toolbar = Ext.create('Ext.toolbar.Toolbar',{
		items:[
			{text:'启动',iconCls:'icon_server_started'}
			,'-',
			{text:'停止',iconCls:'icon_server_stopped',disabled: true}
		]
		,dock:'top'
	});
	
	mainWindow.add(tabpanel);
	mainWindow.addDocked(toolbar);
	mainWindow.show();
	
	window.onunload = function(){
		try {
			Ext.destroy(mainWindow);
		} catch (e) {
			alert('回收资源异常!' +e);
		}
	};
}

function createForm(){
	var form = Ext.create('Ext.form.Panel',{
		bodyPadding: 5
		,frame: false
		,bodyStyle :'border-width : 1px; border-radius: 4px'
		,fieldDefaults: {
            labelAlign: 'right',
            labelWidth: 60,
            anchor: '100%'
        }
		,items:[
			 {
	            xtype: 'textareafield',
	            name: 'discription',
	            fieldLabel: '说明'
	            ,grow:false
	            ,emptyText :'请输入说明'
	            ,maxLength :50
	            ,height:50
	        }
	        ,{
	        	layout:'column'
	        	,baseCls : 'noBorder'
	        	,defaults: {
	        	}
	        	,items:[
	        		{
	        			columnWidth:0.9,
			        	xtype:'sliderfield',
			        	fieldLabel:'百分比',
			        	hideLabel: false,
				        minValue: 1,
				        maxValue: 100
				    },{
	        			columnWidth:0.1
	        			,xtype:'label'
	        			,text:'1%'
	        		}
	        	]
	        }
		    ,{
		    	xtype:'tabpanel'
		    	,plain: true
		    	,tabPosition: 'top'
		    	,activeTab: 0
		    	,layout:'fit'
		    	,defaults: {
		            autoScroll:true
		            ,layout:'fit'
		            //,html:'中华人民共和国中华人民共和国中华人民共和国'
		        }
		    	,items:[
		    		{
		    			title:'销售字段'
		    			,bodyStyle:'border-width : 0px'
		    			,items:[{
				            xtype: 'itemselector',
				            name: 'itemselector',
				            anchor: '100%',
				            store: store,
				            displayField: 'name',
				            valueField: 'fieldCode',
				            value: ['3', '4', '6'],
				
				            allowBlank: true,
				            // minSelections: 2,
				            // maxSelections: 3,
				            msgTarget: 'side'
				            
				            ,multiselects:[
				            	{
				            		listTitle :'未选的字段'
				            		,bodyStyle:'border-width : 0px'
				            		,boundListCls:'noLeftAndBottom'
				            		,headerCls:'noTopAndLeft'
				            	}
				            	,{
				            		listTitle :'已选的字段'
				            		,bodyStyle:'border-width : 0px'
				            		,boundListCls:'noRightAndBottom'
				            		,headerCls:'noTopAndRight'
				            	}
				            ]
				        }]
		    		}
		    		,{title:'采购字段'}
		    		,{title:'库存字段'}
		    	]
		    }
		]
	});
	
	var panel = Ext.create('Ext.panel.Panel',{
		title: '必填字段'
		,items:[form]
		,frame:true
		,layout:'fit'
		,bodyStyle :'border-width : 0px; '
		//,baseCls: 'noBorder'
		,buttons: [{
            text: '应用',
            iconCls:'icon_save',
            width:5,
            handler: function(){
               
            }
        }]
	});
	
	return panel;
}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值