shlomiassaf / ngrid

A angular grid for the enterprise

Home Page:https://shlomiassaf.github.io/ngrid

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to use Angular Drag and Drop with Ngrid

rbv3 opened this issue · comments

First of all, sorry if I report something wrong, my native language is not english and this is the first time I'm reporting an issue on github, but I'll try my best.

What is the expected behavior?

I want to use both, Ngrid and Angular drag and drop at the same time.

What is the current behavior?

When I'm using Ngrid, I get the following error when trying to use angular drag and drop:

Uncaught TypeError: Cannot read property 'getViewportScrollPosition' of undefined
at PblDropListRef._listenToScrollEvents (drag-drop.js:2351)
at PblDropListRef._startReceiving (drag-drop.js:2332)
at drag-drop.js:1685
at Array.forEach ()
at PblDropListRef.start (drag-drop.js:1681)
at PblDragRef._startDragSequence (drag-drop.js:746)
at drag-drop.js:317
at ZoneDelegate.invoke (zone-evergreen.js:359)
at Object.onInvoke (core.js:39698)
at ZoneDelegate.invoke (zone-evergreen.js:358)

What are the steps to reproduce?

This stackblitz contains all dependencies I'm using on my project. I know that, probably, this is not a direct effect of Ngrid on Angular Drag and Drop, but I wasn't able to find which one.
https://stackblitz.com/edit/pebula-ngrid-starter-w1i66a-test
If you try to drag an item from the lists below the table, it'll give the error mentioned above

Which versions of Angular, CDK, Material, NGrid, OS, TypeScript, browsers are affected?

Angular: 8.2.4
"@angular/cdk": "^8.2.3",
"@angular/material": "^8.1.4",
"@pebula/ngrid": "^1.0.0-rc.13",
Manjaro Linux,
"typescript": "~3.5.3"
Google Chrome and Firefox (not tested on Edge/Internet Explorer and Safari)

Is there anything else we should know?

If you want more information or anything, I'll be very glad to help! Thanks, in advance

Any feedback on this ?

Having the same issue in our project. Also it seems that ngrid requires @angular/cdk-experimental in order to be compiled with the project.

OK.

I think I understand what's going on... CDK 8.2.3 has changes from pervious CDK that i'm using...
Need to update support.

I'll work on it.

@rbv3 Working now

https://stackblitz.com/edit/pebula-ngrid-starter-w1i66a-test-gse668?file=package.json

I just changed the version to rc14 (from rc13)

    "@pebula/ngrid": "1.0.0-rc.14",
    "@pebula/ngrid-material": "1.0.0-rc.14",

@SAnDAnGE

If you're using the virtual scroll plugin you also need to have the cdk-experimental package because it has the AutoSize virtual scroll strategy which is used by the grid by default.