⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 demo.htm

📁 java script web控件 包含了树 列表 表单的操作
💻 HTM
字号:
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
	<link href="../component.css" rel="stylesheet" type="text/css">
	<script src="../ReportPrinter.js"></script>
	<script src="../SigmaBase.js"></script>
	<script src="../grid.js"></script>
	<title>Report Demo</title>

	<script language="javascript">
		var p = null;
		var grid = null;

		window.onload = function(){
			
			grid = new SigmaGrid();
			var header = [
					{name:"user.name",caption:"姓名",locked:"false",mode:"link",width:60,href:"nameClicked"},
					{name:"user.sex",caption:"性别",locked:"false",width:60,mode:"string"},
					{name:"cols2",caption:"日期",locked:"false",width:100,mode:"date"},
					{name:"checkTest",caption:"check",locked:"false",width:100,mode:"check"},
					{name:"cols3",caption:"爱好",locked:"false",width:100,mode:"string",listener:"onDblClicked",align:"center"},
					{name:"user.salary",caption:"月薪",locked:"false",mode:"money",width:100,listener:"onValueChanged"},
					{name:"title",caption:"岗位",locked:"false",mode:"select",width:100,readonly:false,
						options:[
						{id:1,name:"程序员"},
						{id:2,name:"部门经理"},
						{id:3,name:"技术总监"}],
						listener:"titleChanged"}
				];

			var data = [
						{cols1:"col1",cols2:"2003-04-03 10:20:30",user:{id:1,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",cols3:null,user:{id:3,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",user:{id:4,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",user:{id:1,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",user:{id:1,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",cols3:null,user:{id:3,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",user:{id:4,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",user:{id:1,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",user:{id:1,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",cols3:null,user:{id:3,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",user:{id:4,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",user:{id:1,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",user:{id:1,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",cols3:null,user:{id:3,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",user:{id:4,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",user:{id:1,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",user:{id:1,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",cols3:null,user:{id:3,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",user:{id:4,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",user:{id:1,name:"hxd",sex:"男",salary:12000}},{cols1:"col1",cols2:"2003-04-03 10:20:30",user:{id:1,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",cols3:null,user:{id:3,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",user:{id:4,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",user:{id:1,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",user:{id:1,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",cols3:null,user:{id:3,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",user:{id:4,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",user:{id:1,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",user:{id:1,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",cols3:null,user:{id:3,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",user:{id:4,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",user:{id:1,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",user:{id:1,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",cols3:null,user:{id:3,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",user:{id:4,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",user:{id:1,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",user:{id:1,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",cols3:null,user:{id:3,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",user:{id:4,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",user:{id:1,name:"hxd",sex:"男",salary:12000}},
						{cols1:"col1",cols2:"2003-04-03 10:20:30",user:{id:1,name:"hxd",sex:"男",salary:12000}}
					]
			document.all("aa").appendChild(grid.getElement());
			grid.setHeight(200);
			grid.setWidth(500);
			grid.setContext({
				sequence:true,checkBox:true,readonly:false,sum:[]
			});
			grid.setMenus([]);
			grid.bindHeader(header);
			grid.bindData(data);
			
		}

		function print(){
			report_template_url = "../reportTemplate.htm";
			p = new ReportPrinter();
			p.params.pageWidth = 210;
			p.params.pageHeight = 100;
			p.params.marginLeft = 5;
			p.params.marginRight = 5;
			p.params.marginTop = 5;
			p.params.marginBottom = 5;
			p.setGrid(grid);
			p.pHeader='<table border=0 width="100%"><tr><td colspan=3 align=center>慧软公司库存总帐报表</tr><tr><td colspan=3 align="right">制表日期:06年4月5日</td></tr></table>';
			p.pFoot = "<div style='text-align:right;'>制表人:何晓东</div>";
			p.view();
		}
	</script>
</head>

<body>
	<div id="aa"></div>
	<button onclick="print();">打印</button>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -