87,907
社区成员
发帖
与我相关
我的任务
分享
public ActionResult MeterJson()
{
string json = "{\"total\":1,\"rows\":[{\"productid\":\"FI-SW-01\",\"productname\":\"Koi\",\"unitcost\":10.00,\"status\":\"P\",\"listprice\":36.50,\"attr1\":\"Large\",\"itemid\":\"EST-1\"}]}";
return Content(json.ToString(),"Application/json");
}
<table id="dataResult" class="easyui-datagrid" title="查询结果"
data-options="
rownumbers:true,
singleSelect:true,
autoRowHeight:false,
singleSelect:true,
pagination:true,
pageNumber:1,
url:'/Query/MeterJson',
width:1250">
<thead>
<tr>
<th data-options="field:'itemid',width:170">Item ID</th>
<th data-options="field:'productid',width:170">Product</th>
<th data-options="field:'listprice',width:170,align:'right'">List Price</th>
<th data-options="field:'unitcost',width:170,align:'right'">Unit Cost</th>
<th data-options="field:'attr1',width:170">Attribute</th>
<th data-options="field:'status',width:170,align:'center'">Status</th>
</tr>
</thead>
</table>
<table id="Text"></table>
$('#DepartmentList').datagrid({
width: 585,
height: 350,
nowrap: false,
striped: true,
collapsible: true,
pageSize: 50,
url: website + '这是地址',
sortName: 'Name',
sortOrder: 'asc',
remoteSort: false,
idField: 'F5Key',
frozenColumns: [[
{ field: 'ck', checkbox: true }
]],
columns: [[
{ title: '多大', field: 'Name', width: 150, sortable: true },
{ field: 'ShortName', title: '多大', width: 100, sortable: true },
{ field: 'Dname', title: '多大', width: 120, sortable: true }
]],
pagination: true,
rownumbers: true
});