revogrid icon indicating copy to clipboard operation
revogrid copied to clipboard

When sorting data disappears

Open tarasowski opened this issue 2 years ago • 15 comments

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

tarasowski avatar Dec 21 '21 15:12 tarasowski

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

xWayfinder avatar Dec 22 '21 02:12 xWayfinder

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

JulienGrv avatar Dec 22 '21 09:12 JulienGrv

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

shatindle avatar Jan 10 '22 18:01 shatindle

Hey folks, have anyone found a solution?

tarasowski avatar Jan 21 '22 04:01 tarasowski

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

JulienGrv avatar Jan 21 '22 06:01 JulienGrv

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

  • I checked out tag v3.0.98 and ran the npm run server to spin up the demo. ✅ Sorting works correctly
  • I replaced the script tags pointing to the build output with a script tag pointing to the CDN and I am able to recreate the issue. ❌ Sorting doesn't work (as described in the issue)

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/[email protected]/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.

xWayfinder avatar Jan 22 '22 10:01 xWayfinder

@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.

shatindle avatar Jan 22 '22 14:01 shatindle

@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?

xWayfinder avatar Jan 23 '22 05:01 xWayfinder

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

tarasowski avatar Jan 24 '22 05:01 tarasowski

@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

shatindle avatar Jan 24 '22 14:01 shatindle

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.

tarasowski avatar Jan 24 '22 15:01 tarasowski

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.

nomeaning777 avatar Nov 09 '22 01:11 nomeaning777

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.

AndreyCerqueiraLima avatar Jan 09 '24 17:01 AndreyCerqueiraLima

Bug still exists for anyone who ends up here

prasoon2211 avatar Mar 11 '24 03:03 prasoon2211