Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReferenceError: Can't find variable: NESTED_CODE_TYPE_MAP #293

Open
deepdatatop opened this issue Oct 20, 2023 · 0 comments
Open

ReferenceError: Can't find variable: NESTED_CODE_TYPE_MAP #293

deepdatatop opened this issue Oct 20, 2023 · 0 comments

Comments

@deepdatatop
Copy link

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();
}
}
]
}
]
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant