fin-hypergrid / core

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

Rerendering #18

Closed ahmednuaman closed 9 years ago

ahmednuaman commented 9 years ago

So unless I'm being really dumb (which there certainly is a possibility of this) I'm having issues re-rendering the table. I've created a little example: http://ahmednuaman.github.io/hypergrid-rerender-test/

From your demos it appears that you're just hiding and showing each "tab", whereas with most modern JS frameworks they add and remove HTML partials from the main views. The demo I've created essentially does that. Loads a HTML partial containing the table, gives it data, then if you hit the load button again it all starts off cool but no data is displayed.

I've spent some time looking into this and I can see the methods hitting the table, the table flushing the buffer canvas cache and so on, but nothing is rendered. What's also interesting is that for each time the table is re-rendered it adds two new buffer <canvas> elements, I'm thinking that these can probably be given an id so they can be reused somehow, maybe by providing it with a name?

stevewirts commented 9 years ago

I'll take a look,

On Mon, Feb 23, 2015 at 6:45 AM, Ahmed Nuaman notifications@github.com wrote:

So unless I'm being really dumb (which there certainly is a possibility of this) I'm having issues re-rendering the table. I've created a little example: http://ahmednuaman.github.io/hypergrid-rerender-test/

From your demos it appears that you're just hiding and showing each "tab", whereas with most modern JS frameworks they add and remove HTML partials from the main views. The demo I've created essentially does that. Loads a HTML partial containing the table, gives it data, then if you hit the load button again it all starts off cool but no data is displayed.

I've spent some time looking into this and I can see the methods hitting the table, the table flushing the buffer canvas cache and so on, but nothing is rendered. What's also interesting is that for each time the table is re-rendered it adds two new buffer elements, I'm thinking that these can probably be given an id so they can be reused somehow, maybe by providing it with a name?

— Reply to this email directly or view it on GitHub https://github.com/openfin/fin-hypergrid/issues/18.

ahmednuaman commented 9 years ago

Thanks. I'm doing some checking myself too.

stevewirts commented 9 years ago

Hi Ahmed, I got it to work doing 2 things, 1) you don't want to import the fin-hypergrid.html file more than once, so that import needs to be placed globally in your main document; 2) there are polymer lifecycle callback issues that haven't been resolved yet, I've incorporated a reasonable yet imperfect solution for now,

I added a artificial load event for the fin-hypergrid and you can hook into that. It gets called AFTER the hypergrid is ready. All you need to do is use this,

see... http://openfin.github.io/fin-hypergrid/components/fin-hypergrid/examples/partialtest.html

On Mon, Feb 23, 2015 at 6:45 AM, Ahmed Nuaman notifications@github.com wrote:

So unless I'm being really dumb (which there certainly is a possibility of this) I'm having issues re-rendering the table. I've created a little example: http://ahmednuaman.github.io/hypergrid-rerender-test/

From your demos it appears that you're just hiding and showing each "tab", whereas with most modern JS frameworks they add and remove HTML partials from the main views. The demo I've created essentially does that. Loads a HTML partial containing the table, gives it data, then if you hit the load button again it all starts off cool but no data is displayed.

I've spent some time looking into this and I can see the methods hitting the table, the table flushing the buffer canvas cache and so on, but nothing is rendered. What's also interesting is that for each time the table is re-rendered it adds two new buffer elements, I'm thinking that these can probably be given an id so they can be reused somehow, maybe by providing it with a name?

— Reply to this email directly or view it on GitHub https://github.com/openfin/fin-hypergrid/issues/18.

ahmednuaman commented 9 years ago

Amazing!