fin-hypergrid / core

A canvas-based super high performant grid renderer API
MIT License
897 stars 144 forks source link

Multiple-Grids demo #530

Closed willsolve closed 7 years ago

willsolve commented 7 years ago

I'm getting the following error with the multiple-grids.html demo: Canvas.js:284 TypeError: Cannot read property 'length' of undefined at Constructor.paintCellsByColumnsAndRows [as paintCells] (file:///C:/Users/user/Desktop/demo/fin-hypergrid/build/fin-hypergrid.js:24702:19) at Constructor.renderGrid (file:///C:/Users/user/Desktop/demo/fin-hypergrid/build/fin-hypergrid.js:25752:14) at Constructor.paint (file:///C:/Users/user/Desktop/demo/fin-hypergrid/build/fin-hypergrid.js:25473:18) at Canvas.paintNow (file:///C:/Users/user/Desktop/demo/fin-hypergrid/build/fin-hypergrid.js:20009:28) at Canvas.tickPaint (file:///C:/Users/user/Desktop/demo/fin-hypergrid/build/fin-hypergrid.js:19895:18) at Canvas.beginPainting.tickPainter (file:///C:/Users/user/Desktop/demo/fin-hypergrid/build/fin-hypergrid.js:19913:18) at file:///C:/Users/user/Desktop/demo/fin-hypergrid/build/fin-hypergrid.js:20371:27 at Array.forEach (native) at paintLoopFunction (file:///C:/Users/user/Desktop/demo/fin-hypergrid/build/fin-hypergrid.js:20369:20)

The problem happens when this is called on the second iteration/instance grid[i] = new fin.Hypergrid(options);

I traced it to the following code, and if the reset line is commented out, then it renders again: fin-hypergrid.js line 24691 (by-columns-and-rows.js line 52)

if (paintCellsByColumnsAndRows.reset) { this.resetAllGridRenderers(); / paintCellsByColumnsAndRows.reset = false; / bundleRows.call(this, false); bundleColumns.call(this, true); } else if (paintCellsByColumnsAndRows.rebundle) { paintCellsByColumnsAndRows.rebundle = false; bundleColumns.call(this); }

Dwaynekj commented 7 years ago

@willsolve Thanks for pointing this out. We will add to our backlog

Dwaynekj commented 7 years ago

@joneit I think we should add a defaults rendererReset Property rather than this pattern for by-cells, by-columns, by-rows

vodanh109 commented 7 years ago

Hi, I merged this fixed code into my Hypergrid.js file. It passed the error. However, when I try to reset the data, it still print out this error: Cannot read property 'top' of undefined at Constructor.getGridCellFromMousePoint

Dwaynekj commented 7 years ago

@vodanh109 Are you using alpha?

vodanh109 commented 7 years ago

@Dwaynekj, I'm just using the latest release version, but merge the code u fixed for this issue

Dwaynekj commented 7 years ago

So your saying this is your changeset from master? https://github.com/openfin/fin-hypergrid/pull/564/files

Could give alpha a try?

vodanh109 commented 7 years ago

Hi, I tried to build from Alpha by Gulp. But it has some errors. After removing some tasks (test, add-ons, ...), and using the output file in my app, it caused another error. So can u give to me the final output file of Alpha

Dwaynekj commented 7 years ago

This worked for me and out our Travis build. Could you confirm you ran an npm install prior to gulp? If not can you paste your gulp errors here?

vodanh109 commented 7 years ago

yes, of course. I ran npm install & up to date

Dwaynekj commented 7 years ago

Ah, ok cool. Could you paste the error?

vodanh109 commented 7 years ago

If u mean the error when building alpha, here it is: `

[15:06:28] Starting 'lint'...
[15:06:49] Finished 'lint' after 21 s
[15:06:49] Starting 'images'...
[15:06:51] Finished 'images' after 1.88 s
[15:06:51] Starting 'css-templates'...
[15:06:51] Finished 'css-templates' after 183 ms
[15:06:51] Starting 'dialogs-css-templates'...
[15:06:51] Finished 'dialogs-css-templates' after 33 ms
[15:06:51] Starting 'dialogs-html-templates'...
[15:06:51] Finished 'dialogs-html-templates' after 125 ms
[15:06:51] Starting 'test'...

  Base
    Module expected shape
      √ Should have the instance shape (100ms)
    extend
      √ Should create a new constructor
      Should extend with
        √ Should extend with HypergridError
        √ Should extend with deprecated
        √ Should extend with unwrap
    HypergridError
      √ should assign the message

  CSS
    Module expected shape
      1) Should have theinstance shape
      2) Should not be empty

  SelectionModel
    Module expected shape
      √ Should have the instance shape (80ms)

  7 passing (300ms)
  2 failing

  1) CSS Module expected shape Should have theinstance shape:
     H:\fin-hypergrid\css\index.js:4
'.hypergrid-container {
^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Invalid or unexpected token
      at Object.exports.runInThisContext (vm.js:76:16)
      at require (internal/module.js:20:19)
      at Context.<anonymous> (H:\fin-hypergrid\test\css-test.js:16:23)
      at callFn (H:\fin-hypergrid\node_modules\mocha\lib\runnable.js:326:21)

  2) CSS Module expected shape Should not be empty:
     H:\fin-hypergrid\css\index.js:4
'.hypergrid-container {
^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Invalid or unexpected token
      at Object.exports.runInThisContext (vm.js:76:16)
      at require (internal/module.js:20:19)
      at Context.<anonymous> (H:\fin-hypergrid\test\css-test.js:24:23)
      at callFn (H:\fin-hypergrid\node_modules\mocha\lib\runnable.js:326:21)

[15:06:57] 'test' errored after 6.14 s
[15:06:57] Error in plugin 'gulp-mocha'
Message:
    2 tests failed.
[15:06:57] 'build' errored after 29 s
[15:06:57] Error in plugin 'run-sequence(test)'
Error
    at finish (H:\fin-hypergrid\node_modules\run-sequence\index.js:56:13)
    at Gulp.onError (H:\fin-hypergrid\node_modules\run-sequence\index.js:67:4)
    at emitOne (events.js:101:20)
    at Gulp.emit (events.js:188:7)
    at Gulp.Orchestrator._emitTaskDone (H:\fin-hypergrid\node_modules\orchestrat
or\index.js:264:8)
    at H:\fin-hypergrid\node_modules\orchestrator\index.js:275:23
    at finish (H:\fin-hypergrid\node_modules\orchestrator\lib\runTask.js:21:8)
    at Stream.<anonymous> (H:\fin-hypergrid\node_modules\orchestrator\lib\runTas
k.js:52:4)
    at Stream.f (H:\fin-hypergrid\node_modules\once\once.js:17:25)
    at emitOne (events.js:101:20)
Dwaynekj commented 7 years ago

@vodanh109 Whats your environment and node version?

vodanh109 commented 7 years ago

I'm working on Window 7 64 bit, node version v6.9.1

Dwaynekj commented 7 years ago

One more test. Could you try develop?

vodanh109 commented 7 years ago

I didn't change anything yet. Just checkout Alpha then run Gulp. Do u mean that u want me to try develop sth? I'm just a newbie for hypergrid. But if there is any instruction, I may try for it

vodanh109 commented 7 years ago

Hi @Dwaynekj , After update few codes in gulp file, I can build successfully. It seem that the error is still existing.

There are also another errors: TypeError: Cannot read property 'reset' of undefined at eval (eval at webpackJsonp.11.module.exports (http://localhost:4200/scripts.bundle.js:14:8), <anonymous>:24573:24) at Array.forEach (native) at Array.value (eval at webpackJsonp.11.module.exports (http://localhost:4200/scripts.bundle.js:14:8), <anonymous>:25220:48) at Constructor.bundleColumns (eval at webpackJsonp.11.module.exports (http://localhost:4200/scripts.bundle.js:14:8), <anonymous>:24569:29) at Constructor.paintCellsByColumnsAndRows (eval at webpackJsonp.11.module.exports (http://localhost:4200/scripts.bundle.js:14:8), <anonymous>:24804:23) at Constructor.renderGrid (eval at webpackJsonp.11.module.exports (http://localhost:4200/scripts.bundle.js:14:8), <anonymous>:25916:38) at Constructor.paint (eval at webpackJsonp.11.module.exports (http://localhost:4200/scripts.bundle.js:14:8), <anonymous>:25637:18) at Canvas.paintNow (eval at webpackJsonp.11.module.exports (http://localhost:4200/scripts.bundle.js:14:8), <anonymous>:20107:28) at Canvas.tickPaint (eval at webpackJsonp.11.module.exports (http://localhost:4200/scripts.bundle.js:14:8), <anonymous>:19993:18) at Canvas.tickPainter (eval at webpackJsonp.11.module.exports (http://localhost:4200/scripts.bundle.js:14:8), <anonymous>:20011:18)

and this one

TypeError: Cannot read property 'visibleColumn' of undefined at Constructor.eval (eval at webpackJsonp.11.module.exports (http://localhost:4200/scripts.bundle.js:14:8), <anonymous>:24831:23) at Array.forEach (native) at Array.value (eval at webpackJsonp.11.module.exports (http://localhost:4200/scripts.bundle.js:14:8), <anonymous>:25220:48) at Constructor.paintCellsByColumnsAndRows (eval at webpackJsonp.11.module.exports (http://localhost:4200/scripts.bundle.js:14:8), <anonymous>:24828:25) at Constructor.renderGrid (eval at webpackJsonp.11.module.exports (http://localhost:4200/scripts.bundle.js:14:8), <anonymous>:25916:38) at Constructor.paint (eval at webpackJsonp.11.module.exports (http://localhost:4200/scripts.bundle.js:14:8), <anonymous>:25637:18) at Canvas.paintNow (eval at webpackJsonp.11.module.exports (http://localhost:4200/scripts.bundle.js:14:8), <anonymous>:20107:28) at Canvas.tickPaint (eval at webpackJsonp.11.module.exports (http://localhost:4200/scripts.bundle.js:14:8), <anonymous>:19993:18) at Canvas.tickPainter (eval at webpackJsonp.11.module.exports (http://localhost:4200/scripts.bundle.js:14:8), <anonymous>:20011:18) at eval (eval at webpackJsonp.11.module.exports (http://localhost:4200/scripts.bundle.js:14:8), <anonymous>:20469:27) at Array.forEach (native) at paintLoopFunction (eval at webpackJsonp.11.module.exports (http://localhost:4200/scripts.bundle.js:14:8), <anonymous>:20467:20) at ZoneDelegate.invokeTask (http://localhost:4200/polyfills.bundle.js:6541:31) at Zone.runTask (http://localhost:4200/polyfills.bundle.js:6344:47) at ZoneTask.invoke (http://localhost:4200/polyfills.bundle.js:6594:38) paintNow @ VM7957:20110 tickPaint @ VM7957:19993 tickPainter @ VM7957:20011 (anonymous) @ VM7957:20469 paintLoopFunction @ VM7957:20467 ZoneDelegate.invokeTask @ zone.js:363 Zone.runTask @ zone.js:166 ZoneTask.invoke @ zone.js:416 data.args.(anonymous function) @ zone.js:1527 VM7957:20110 TypeError: Cannot read property 'visibleColumn' of undefined at Constructor.eval (eval at webpackJsonp.11.module.exports (http://localhost:4200/scripts.bundle.js:14:8), <anonymous>:24831:23) at Array.forEach (native) at Array.value (eval at webpackJsonp.11.module.exports (http://localhost:4200/scripts.bundle.js:14:8), <anonymous>:25220:48) at Constructor.paintCellsByColumnsAndRows (eval at webpackJsonp.11.module.exports (http://localhost:4200/scripts.bundle.js:14:8), <anonymous>:24828:25) at Constructor.renderGrid (eval at webpackJsonp.11.module.exports (http://localhost:4200/scripts.bundle.js:14:8), <anonymous>:25916:38) at Constructor.paint (eval at webpackJsonp.11.module.exports (http://localhost:4200/scripts.bundle.js:14:8), <anonymous>:25637:18) at Canvas.paintNow (eval at webpackJsonp.11.module.exports (http://localhost:4200/scripts.bundle.js:14:8), <anonymous>:20107:28) at Canvas.tickPaint (eval at webpackJsonp.11.module.exports (http://localhost:4200/scripts.bundle.js:14:8), <anonymous>:19993:18) at Canvas.tickPainter (eval at webpackJsonp.11.module.exports (http://localhost:4200/scripts.bundle.js:14:8), <anonymous>:20011:18)

Dwaynekj commented 7 years ago

@vodanh109 So you can build but you still get that error? It seems you are using webpack, we don't have webpack in our builds

vodanh109 commented 7 years ago

Hi @Dwaynekj , I don't think Webpack is the root cause. Because actually the hypergrid is still working, but only console log throws some above errors

Dwaynekj commented 7 years ago

interesting maybe we ought to do a quick screen sharing next week

vodanh109 commented 7 years ago

Okay. I can prepare for it. Pls comment whenever u want to do it

Dwaynekj commented 7 years ago

The first half of week is pretty busy so how about this thursday/Friday around 3pm Est?

Dwaynekj commented 7 years ago

@vodanh109 Lets use https://github.com/openfin/fin-hypergrid/issues/579 for future discussions

Dwaynekj commented 7 years ago

Someone provided a workaround here https://github.com/openfin/fin-hypergrid/issues/579#issuecomment-291951540

vodanh109 commented 7 years ago

Hi @Dwaynekj, Sorry for no response in recent days. I can handle the problem with window build. But what i care is the error with multi grid. Maybe you forgot this problem

Dwaynekj commented 7 years ago

@vodanh109 The multi grid has already been resolved on develop and is on the latest alpha