日期:2014-05-17 浏览次数:20849 次
 $('#userDatagrid')
				.datagrid(
						{
							url : 'userAction!datagrid',
							title : '用户管理',
							iconCls : 'icon-save',
							pagination : true,
							pageSize : 10,
							pageList : [ 10, 20, 30, 50, 100, 200 ],
							fit : true,
							fitColumns : false,
							nowrap : true,
							border : false,
							idField : 'id',
							columns : [ [
									{
										title : '编号',
										field : 'id',
										width : 100,
										sortable : true,
										checkbox : true,
									},
									{
										title : '名字',
										field : 'name',
										width : 100,
										sortable : true,
										editor : {
											type : 'validatebox',
											options : {
												required : true
											}
										}
									},
									{
										title : '密码',
										field : 'password',
										width : 230,
										editor : {
											type : 'validatebox',
											options : {
												required : true
											}
										},
										formatter : function(value, rowIndex,
												rowData) {
											return '<span title="'+value+'">'
													+ value + '</span>';
										}
									}
.....
....<table id="dg" class="easyui-datagrid"
data-options=" url: '填写你提交表单的文件',
"
>
<thead>
<tr>
<th field="表单内元素的名称1" width="90" >标题</strong></th>
<th field="表单内元素的名称2" width="90" >标题</strong></th>
<tr>
</thead>
$('#dg').datagrid('reload');
还有中更简单的办法
<table id="dg" class="easyui-datagrid"
data-options=" url: '填写你提交表单的文件',
"
>
<thead>
<tr>
<th field="表单内元素的名称1" width="90" >标题</strong></th>
<th field="表单内元素的名称2