angular 带有可为空字符串的光滑网格复杂对象

angular slick grid complex object with nullable string

我正在使用 angular slickgrid

  { id: 'fullName', field: 'user.fullName', name: 'Agent Name', filterable: true, sortable: true, formatter: Formatters.complexObject }, 

仅当全名可以为 null 时才会显示错误 来自 json 的数据存在 我正在低于

EDIT:

ERROR TypeError: Cannot read property 'width' of null
    at getCanvasWidth (vendor.js:195836)
    at getViewportHeight (vendor.js:198686)
    at SlickGrid.resizeCanvas (vendor.js:198712)
    at ResizerService.resizeGridWithDimensions (vendor.js:94087)
    at ResizerService.resizeGridCallback (vendor.js:94061)
    at vendor.js:94053
    at timer (polyfills.js:13097)
    at ZoneDelegate.invokeTask (polyfills.js:10942)
    at Object.onInvokeTask (vendor.js:43226)
    at ZoneDelegate.invokeTask (polyfills.js:10941)
defaultErrorLogger @ core.js:6456
handleError @ core.js:6504
next @ core.js:29284
__tryOrUnsub @ Subscriber.js:183
next @ Subscriber.js:122
_next @ Subscriber.js:72
next @ Subscriber.js:49
next @ Subject.js:39
emit @ core.js:25946
(anonymous) @ core.js:28703
invoke @ zone.js:372
run @ zone.js:134
runOutsideAngular @ core.js:28576
onHandleError @ core.js:28703
handleError @ zone.js:376
runTask @ zone.js:181
invokeTask @ zone.js:487
ZoneTask.invoke @ zone.js:476
data.args.<computed> @ zone.js:2541
core.js:6456 ERROR TypeError: Cannot convert undefined or null to object
    at Function.entries (<anonymous>)
    at complexObjectFormatter (vendor.js:101862)
    at appendCellHtml (vendor.js:198432)
    at appendRowHtml (vendor.js:198386)
    at renderRows (vendor.js:199153)
    at render (vendor.js:199258)
    at resizeCanvas (vendor.js:198814)
    at updateRowCount (vendor.js:198910)
    at SlickGrid.invalidate (vendor.js:198490)
    at DataView.<anonymous> (vendor.js:103566)
defaultErrorLogger @ core.js:6456
core.js:6456 ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'children' of null
TypeError: Cannot read property 'children' of null
    at ensureCellNodesInRowsCache (vendor.js:198967)
    at cleanUpAndRenderCells (vendor.js:199053)
    at render (vendor.js:199254)
    at SlickGrid.resizeCanvas (vendor.js:198814)
    at ResizerService.resizeGridWithDimensions (vendor.js:94087)
    at ResizerService.resizeGridCallback (vendor.js:94061)
    at vendor.js:94056
    at new ZoneAwarePromise (polyfills.js:11923)
    at ResizerService.resizeGrid (vendor.js:94048)
    at ResizerService.handleResizeGrid (vendor.js:93949)
    at resolvePromise (polyfills.js:11749)
    at new ZoneAwarePromise (polyfills.js:11926)
    at ResizerService.resizeGrid (vendor.js:94048)
    at ResizerService.handleResizeGrid (vendor.js:93949)
    at dispatch (scripts.js:5430)
    at $event.dispatch (scripts.js:11280)
    at $event.dispatch (vendor.js:187486)
    at elemData.handle (scripts.js:5234)
    at ZoneDelegate.invokeTask (polyfills.js:10942)
    at Object.onInvokeTask (vendor.js:43226)
defaultErrorLogger @ core.js:6456
core.js:6456 ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'children' of null
TypeError: Cannot read property 'children' of null
    at ensureCellNodesInRowsCache (vendor.js:198967)
    at cleanUpAndRenderCells (vendor.js:199053)
    at render (vendor.js:199254)
    at SlickGrid.resizeCanvas (vendor.js:198814)
    at ResizerService.resizeGridWithDimensions (vendor.js:94087)
    at ResizerService.resizeGridCallback (vendor.js:94061)
    at vendor.js:94056
    at new ZoneAwarePromise (polyfills.js:11923)
    at ResizerService.resizeGrid (vendor.js:94048)
    at ResizerService.handleResizeGrid (vendor.js:93950)
    at resolvePromise (polyfills.js:11749)
    at new ZoneAwarePromise (polyfills.js:11926)
    at ResizerService.resizeGrid (vendor.js:94048)
    at ResizerService.handleResizeGrid (vendor.js:93950)
    at dispatch (scripts.js:5430)
    at $event.dispatch (scripts.js:11280)
    at $event.dispatch (vendor.js:187486)
    at elemData.handle (scripts.js:5234)
    at ZoneDelegate.invokeTask (polyfills.js:10942)
    at Object.onInvokeTask (vendor.js:43226)

以上错误仅针对具有空数据的复杂对象。请告诉我如何配置。
@gistcode 我添加了更多错误日志..请检查,你能提供我如何为这个用例转换自定义格式吗

请注意,我是 Angular-Slickgrid

的作者

这是一个我能够复制的错误,我只是推送了一个 PR fix 来解决这个问题,还发布了一个新的补丁版本 2.30.5(该修复程序也将在最新版本中提供主要版本 3.x)。只需更新到版本 2.30.5,您就可以开始了。