版本
7.4.0 classic
原因
extjs对组件属性id,itemId存在格式校验。以字母或下划线开始,后面可跟随字母,下划线,数字或连字符
Valid identifiers start with a letter or underscore and are followed by (optional) additional letters, underscores, digits or hyphens.
源码
- ext-classic/src/Component.js
constructor: function(config) {
if (!me.validIdRe.test(me.id)) {
Ext.raise('Invalid component "id": "' me.id '"');
}
if (!me.validIdRe.test(me.itemId)) {
Ext.raise('Invalid component "itemId": "' me.itemId '"');
}
},
...
validIdRe: Ext.validIdRe, // 默认值为 /^[a-z_][a-z0-9-_]*$/i