baukh789 / GridManager

🌐 快速、灵活的对Table标签进行实例化,让Table标签充满活力。
https://gridmanager.lovejavascript.com
MIT License
819 stars 139 forks source link

ReferenceError: Can't find variable: NESTED_CODE_TYPE_MAP #293

Open deepdatatop opened 11 months ago

deepdatatop commented 11 months ago

ReferenceError: Can't find variable: NESTED_CODE_TYPE_MAP gm.js:1:53079

纵表头采用树结构,行表头也采用层次结构。初始化时,出现以上错误。

$('#xxx').GM({ height: '100vh', gridManagerName: 'sectable', supportCheckbox: false, supportAutoOrder: false, supportDrag: false, ajaxData: { "data":[ { name: 'h1~h6', info: '用来定义 HTML 标题', children: [ { name: 'h1', info: '定义重要等级最高的标题' }, { name: 'h2', info: '用来定义 HTML 标题' }, { name: 'h3', info: '用来定义 HTML 标题' }, { name: 'h4', info: '用来定义 HTML 标题' }, { name: 'h5', info: '用来定义 HTML 标题' }, { name: 'h6', info: '定义重要等级最低的标题' } ] }, { name: 'a', info: '定义超链接,用于从一个页面链接到另一个页面' }, { name: 'table', info: '定义 HTML 表格', children: [ { name: 'thead', info: '用于组合 HTML 表格的表头内容', children: [ { name: 'th', info: '定义 HTML 表格中的表头单元格' } ] }, { name: 'tbody', info: '用于组合 HTML 表格的主体内容', children: [ { name: 'td', info: '定义 HTML 表格中的标准单元格' } ] }, { name: 'tfoot', info: '用于组合 HTML 表格的页脚内容' } ] } ],"totals": 3 }, supportTreeData: true, treeConfig: { insertTo: 'name', openState: true, treeKey: 'children' }, columnData: [ { key: 'name', align: 'left', width: '300px', text: '标题' },{ key: 'info', text: '简介' },{ key: 'blogData', text: '博文数据', align: 'left', width: '400px', children: [ { key: 'type', text: '博文分类', align: 'left', width: '150px', template: function(type){ return NESTED_CODE_TYPE_MAP[type]; } }, { key: 'blogInteractive', text: '博文互动', align: 'left', width: '150px', children: [ { key: 'commentSum', text: '评论', align: 'left', width: '150px', }, { key: 'praiseNumber', text: '点赞', align: 'left', width: '150px' }, { key: 'readNumber', text: '阅读', align: 'left', width: '150px', } ] } ] },{ key: 'author', align: 'center', width: '390px', text: '作者', children: [ { key: 'photo', align: 'center', // width: '130px', text: '头像', template: photo => { return ''; } }, { key: 'username', align: 'center', // width: '130px', text: '昵称' }, { key: 'github', align: 'center', width: 110, text: 'github', template: () => { return 'github' } } ] },{ key: 'actionDate', text: '操作时间', sorting: 'DESC', align: "center", width: '280px', children: [ { key: 'createDate', text: '创建时间', sorting: 'DESC', align: "center", width: '140px', template: function(createDate){ return new Date(createDate).toLocaleDateString(); } }, { key: 'lastDate', text: '修改时间', sorting: 'DESC', align: "center", width: '140px', template: function(lastDate){ return new Date(lastDate).toLocaleDateString(); } } ] } ] });