写了两个表 第二个表切换的时候报这个错 不知道怎么解决 求博主帮忙看下
luoxiaofeng369 opened this issue · 5 comments
luoxiaofeng369 commented
// 这段代码真是好蛋疼...
for (var key in obj) {
if (this.fieldMap.get(key).$$optionMap) {
一直报错 这个
InnerTable.js:541 Uncaught (in promise) TypeError: Cannot read property '$$optionMap' of undefined
jiangxy commented
不好意思刚看到,这个问题已经解决了?
luoxiaofeng369 commented
已经解决了 原因是 因为 请求返回的字段没有全部在配置文件进行配置
ElegantLin commented
@luoxiaofeng369 你好,我也遇到了这个问题
Uncaught (in promise) TypeError: Cannot read property '$$optionMap' of undefined
at InnerTable.transformRawDataToTable (InnerTable.js:544)
at InnerTable.eval (makeAssimilatePrototype.js:15)
at eval (InnerTable.js:511)
at Array.forEach (<anonymous>)
at InnerTable.parseTableData (InnerTable.js:510)
at InnerTable.eval (makeAssimilatePrototype.js:15)
at InnerTable.componentWillReceiveProps (InnerTable.js:458)
at InnerTable.eval (makeAssimilatePrototype.js:15)
at ReactCompositeComponentWrapper.updateComponent (ReactCompositeComponent.js:631)
at ReactCompositeComponentWrapper.receiveComponent (ReactCompositeComponent.js:564)
我想知道这段代码的作用,以及我返回的数据在dataSchema
中没有optional的选项,每一个项就是一堆数字,我想问一下你当时是怎么做的呢?
luoxiaofeng369 commented
@ElegantLin 这段代码是循环便利出你请求回来的数据。 解决方法是 ,把你返回出的字段,全部在dataSchema中写出。
ElegantLin commented
@luoxiaofeng369 谢谢你这么快的回复,问题解决了,确实是我粗心。