52,778
社区成员
发帖
与我相关
我的任务
分享 <table class="easyui-datagrid" title="Basic DataGrid" id="dg" style="width:700px;height:250px"
data-options="singleSelect:true,collapsible:true,url:'datagrid_data1.json',method:'get',rownumbers:true,onRowContextMenu:contextMenu">
<thead>
<tr>
<th data-options="field:'itemid',width:80">Item ID</th>
<th data-options="field:'productid',width:100">Product</th>
<th data-options="field:'listprice',width:80,align:'right'">List Price</th>
<th data-options="field:'unitcost',width:80,align:'right'">Unit Cost</th>
<th data-options="field:'attr1',width:250">Attribute</th>
<th data-options="field:'status',width:60,align:'center'">Status</th>
</tr>
</thead>
</table>
下载的压缩包里面不是有很多示例,画葫芦还不会的话就自己多学点基础只是和看下api:http://www.jeasyui.com/documentation/index.php
$('#dg').datagrid({
url:'datagrid_data.json',
columns:[[
{field:'code',title:'Code',width:100},
{field:'name',title:'Name',width:100},
{field:'price',title:'Price',width:100,align:'right'}
]]
});
换成对应的就行了