ag-grid - Exception has occurred: TypeError: Cannot assign to read only property with ag-grid-community cellEditor: 'numericEditor'
问题描述
I am using the example from the Ag-Grid Documentation in a SPFx web part. I managed to use "NumericEditor" from the example (only had to change props to props:any because of typescript ) I do get the input box to show in the grid
But when leave the cell, I get an error in the console and app stopps
Exception has occurred: TypeError: Cannot assign to read only property 'pages' of object '#<Object>'
at ValueService../node_modules/ag-grid-community/dist/ag-grid-community.cjs.js.ValueService.setValueUsingField (https://localhost:4321/dist/ace-multi-steps-request-web-part.js:101927:25)
at ValueService../node_modules/ag-grid-community/dist/ag-grid-community.cjs.js.ValueService.setValue (https://localhost:4321/dist/ace-multi-steps-request-web-part.js:101878:38)
at RowNode../node_modules/ag-grid-community/dist/ag-grid-community.cjs.js.RowNode.setDataValue (https://localhost:4321/dist/ace-multi-steps-request-web-part.js:87664:33)
at CellCtrl../node_modules/ag-grid-community/dist/ag-grid-community.cjs.js.CellCtrl.saveNewValue (https://localhost:4321/dist/ace-multi-steps-request-web-part.js:93946:26)
at CellCtrl../node_modules/ag-grid-community/dist/ag-grid-community.cjs.js.CellCtrl.stopEditing (https://localhost:4321/dist/ace-multi-steps-request-web-part.js:93958:18)
at CellCtrl../node_modules/ag-grid-community/dist/ag-grid-community.cjs.js.CellCtrl.stopRowOrCellEdit (https://localhost:4321/dist/ace-multi-steps-request-web-part.js:93908:18)
at CellCtrl../node_modules/ag-grid-community/dist/ag-grid-community.cjs.js.CellCtrl.onCellFocused (https://localhost:4321/dist/ace-multi-steps-request-web-part.js:94435:18)
The property 'pages' is part of the item in an array of the state used for rowData of the AgGridReact
Can anyone explain this or help? Thanks
I tried also Hook Cell Editor But TypeScript complains on "props.value" until I change to props:any. Also in never finishes the edit like in the sample (the inputbox is visible)
Help :-)
解决方案
推荐阅读
- python - 警报代码有问题,需要用户输入和后台计时器。定时器工作,但不停止程序
- reactjs - 持续部署 - 部署前在前端修改后端 url
- python - Selenium WebDriverException 'chromedriver.exe' 需要在 PATH 中
- java - McEliece 执行中的错误填充
- docker - Docker 容器内的 Cronjob 不运行
- javascript - 电话号码的正则表达式模式号码问题
- c++ - 在 C++ 中设计参数化结构
- javascript - Google 表格 API JavaScript:使用身份验证访问表格
- python - 从磁盘读取文件时批量生成生成器数据就像加载整个数据一样堆积在内存中
- php - 我可以用 mysql php 和表结果来解决这个问题吗?