效果展示
官方文档:Easyui 数据网格视图(DataGrid View)_Easyui扩展
一、引入相关js/css
依次引入
jqery的js
easyUI的js
easyUI的css
最后引入
datagrid-detailview.js(文档中有下载地址)
二、html部分
<div class="table-box" id="print" style="left: 0;margin-top: auto">
<div id="tableList" style="margin-right: 0px">
</div>
</div>
三、js初始化datagrid-detailview
function pageList() {
var ccl = [[
{field: "check", checkbox: "true"},
/*{
field: 'batchNo',
width: 80,
align: 'center',
title: '序号',
editor: {type: "text"},
},*/
{
field: 'centralizedName',
width: 150,
align: 'center',
title: '集采事项名称',
editor: {type: "text"},
},
{
field: 'modeFlag',
width: 120,
align: 'center',
title: '模式',
editor: {
type: 'combobox', options: {
editable: false, prompt: '请选择...',
valueField: 'value',
textField: 'label',
data: [
{label: '公司', value: '0'},
{label: '生产', value: '1'},
{label: '基建', value: '2'}
]
}
},
formatter: function (value, row, index) {
if (value === '0') {
return "公司"
}
if (value === '1') {
return "生产"
}
if(value === '2') {
return "基建"
}
}
},
{
field: 'ifFrameAgreementProject',
width: 150,
align: 'center',
title: '是否框架协议',