aurelia-v-grid / vGrid

Aurelia-v-grid - npm source
MIT License
49 stars 10 forks source link

setColConfig changes the order of the rows and sometimes hides the content #93

Closed TPvanWijk closed 6 years ago

TPvanWijk commented 7 years ago

I have used the v-grid in multiple places in my application and I have noticed that the order of the records changes every time I use the function setColConfig.

I use this function for the responsiveness of the page so this function is called rather often. I first noticed that the rows are empty. Then I made a table with a tree structure so the order of the rows is very important. Here I notest that this function also changes the order of the table.

How do I fix this?

vegarringdal commented 7 years ago

Hi

I will have alook at this, but my house is kinda turned upside/down due to a water leak, so I dont have any computer to do any coding on next 1-2 weeks.

When I try and break it in demo it will only break if scrolltop is not 0 (scrollbar on top) from the few test I did. Really weird bug, hopefully something really simple to fix

vegarringdal commented 7 years ago

I finally got time to look at this Its not a easy fix, to be honest its really messed up and I dont know why atm. From the looks of it I might need to completely clear the grid to make the binding work like it supposed to( doint this will need a lot of rebuilt to work too), dunno if some internal stuff have changed in Aurelia or I just completely manged to miss huge bug

TPvanWijk commented 6 years ago

With the amount of work that you have done, I don't blame you for missing something link this. Your VGrid is a life saver for so far it does work. At this moment we postponed the places where we needed this function. Just let me know when it is fixed and i'll be very happy :D

vegarringdal commented 6 years ago

Yes, hopefully I will be able to fix it...

Tried to look at it yesterday and a little bit today. For some reason all binding goes to h"## when I unbind then rebind and attach my columns.

I also notice now that I can not use "if" attribute with he grid either, since that pretty much does the unbind and and rebind.

vegarringdal commented 6 years ago

Note for my self for the weekend

Maybe I just need to rearrange them to correct order

vegarringdal commented 6 years ago

These: https://github.com/vegarringdal/vGrid/blob/dev-rebuild/src/grid/columnMarkup.ts#L309-L312

Need to be

      this.viewSlots.leftRowViewSlots[i] = this.createViewSlot(this.htmlCache.rowCache[i].left, viewFactoryLeft);
      this.viewSlots.mainRowViewSlots[i] = this.createViewSlot(this.htmlCache.rowCache[i].main, viewFactoryMain);
      this.viewSlots.rightRowViewSlots[i] = this.createViewSlot(this.htmlCache.rowCache[i].right, viewFactoryRight);
      this.viewSlots.groupRowViewSlots[i] = this.createViewSlot(this.htmlCache.rowCache[i].group, viewFactoryGroup);
vegarringdal commented 6 years ago

@TPvanWijk Might have found the root of the issue. Ill post a new link here when I have made a update / new build on master and you can test it before I make a release

vegarringdal commented 6 years ago

@TPvanWijk Made a new build on the master, can you try it and report back.

vegarringdal commented 6 years ago

Now if.bind should be stable too @TPvanWijk so Ill stop doing more updates now untill you have had a chance to test

Published this to npm today too: https://github.com/fuse-box/fuse-box-typechecker (it does not need fusebox to work, can be a pure tslint/typescript type checker too)

vegarringdal commented 6 years ago

@TPvanWijk Did you get a chance to test it (master branch) ?

vegarringdal commented 6 years ago

Fixed in v 1.0.1 Released grid to npm with on v 1.0.1 Update demo to npm v 1.0.1 where you can test.