revolist / revogrid

Powerful virtual data grid smartsheet with advanced customization. Best features from excel plus incredible performance 🔋
https://rv-grid.com
MIT License
2.7k stars 169 forks source link

When sorting data disappears #277

Open tarasowski opened 2 years ago

tarasowski commented 2 years ago

When sorting the data disappears after two sorts. Please see the attached animated gif. sortable-no-data

I'm using Svelte + Revo grid. "@revolist/revogrid-column-date": "^1.1.0", "@revolist/revogrid-column-numeral": "^1.0.2", "@revolist/revogrid-column-select": "^2.0.2", "@revolist/svelte-datagrid": "^3.0.52", "svelte": "^3.29.7",

It doesn't matter which column I sort, the sorting on any column just removes the data from the table.

Thanks in advance, Dimi

xWayfinder commented 2 years ago

I'm also having this issue with Svelte + RevoGrid wondering if this issue belongs in revolist/svelte-datagrid and if it's related to https://github.com/revolist/svelte-datagrid/issues/3

JulienGrv commented 2 years ago

Same here with React using the RevoGrid's React component so it may be related to revo-grid itself

shatindle commented 2 years ago

I'm also having this issue using vanilla js and the CDN. Code Sample

tarasowski commented 2 years ago

Hey folks, have anyone found a solution?

JulienGrv commented 2 years ago

Did you try the next branch? Maybe it's fixed there

xWayfinder commented 2 years ago

Here's what I've found from a little bit of testing.

For reference here's what I changed /src/index.html From

<script type="module" src="/build/revo-grid.esm.js"></script>
<script nomodule src="/build/revo-grid.js"></script> 

To

<script src="https://unpkg.com/@revolist/revogrid@latest/dist/revo-grid/revo-grid.js"></script>

This link above resolves to v3.0.98 https://unpkg.com/@revolist/revogrid@3.0.98/dist/revo-grid/revo-grid.js

I verified that the file on the CDN is the same as the one produced by npm run build

I need to dig a little further to understand why but it looks as though npm run build is not producing a file with the same functionality as in dev.

shatindle commented 2 years ago

@tarasowski I had to go back several version to get it working. It seems a bug was introduced after 3.0.61. Using 3.0.61 solved it for me.

xWayfinder commented 2 years ago

@revolist just wondering if you have any insight on why it might work in dev but not with the CDN version generated from npm run build?

tarasowski commented 2 years ago

Thanks, @shatindle! It looks like an intelligent solution for now, but I'm running on 3.0.52 and the bug still exists.

shatindle commented 2 years ago

@tarasowski are you using the npm package or cdn? 3.0.61 in the cdn doesn't have that issue. I didn't try version before that though

tarasowski commented 2 years ago

I'm using npm, but the issue was with svelte-grid, so I had to downgrade the revolist/revogrid to 3.0.61 and it started working for me.

nomeaning777 commented 1 year ago

This is caused by the incorrect build result for esm-es5.

https://github.com/revolist/revogrid/blob/4df18a24ee9660c6ab485804dbb621c0ad668bfd/src/plugins/sorting/sorting.plugin.ts#L179 For esm-es5, the build result is as follows.

    return __spreadArray([],Array(e.length).keys(),true)}

It returns empty array because __spreadArray of tslib doesn't support Iterator generated by keys() function.

I switched to using the build for ES2017 and the issue was solved.

AndreyCerqueiraLima commented 8 months ago

I have the same problem using version 3.6.16, using npm instalation. When I change the @revolist/revogrid version on package.json to 3.0.98, it was fix.

prasoon2211 commented 5 months ago

Bug still exists for anyone who ends up here

chnk8802 commented 2 months ago

I was using RevoGrid in vanilla JS

For me it worked when in Index.html I changed

<script src="https://cdn.jsdelivr.net/npm/@revolist/revogrid@latest/dist/revo-grid/revo-grid.js"></script>

to

<script src="https://cdn.jsdelivr.net/npm/@revolist/revogrid@3.0.61/dist/revo-grid/revo-grid.js"></script>