-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ColReorder support for Row Expansion in TurboTable #4999
Comments
So I have a solution for the issue in my context. Not really sure it is acceptable. Here comes the conceptual IMHO. Nothing forces developers to set the pReorderableColumn directive on each column of the table. in this case my solution will not work either. Any way I will propose this as a PR in case you think it's acceptable solution. |
Please create a plunkr using; http://plnkr.co/edit/Nxca3ovCbtvx9kpGds0q?p=preview So that we can see the issue in action |
I'm new to plunkr so I hope this will be ok: http://plnkr.co/edit/ZnKbvMJFsS94EYcKG6Wo?p=preview as you can see, drag and dropping is not working correctly especially if you drag and drop rightmost column, you get an error. my PR #5000 proposes a fix, I hope this helps. |
you have this in your code before header loop start, |
exact issue is custom column before loop |
This column has a technical goal (expand / collapse the row) and does not belong to the model of the data displayed in the table. Of course that would do the trick but IMO this is more some sort of hack than a solution. Problem comes from the DomHandler which should check wether a column belongs to the data or not. |
having the same problem |
@loicsalou you are right |
@cagataycivici any chance that this issue be fixed in a short coming fix release ? #5000 provides a fix. Thanks |
Added to plan of 5.2.1 |
There is no guarantee in receiving an immediate response in GitHub Issue Tracker, If you'd like to secure our response, you may consider PrimeNG PRO Support where support is provided within 4 business hours
I'm submitting a ... (check one with "x")
Plunkr Case (Bug Reports)
Please check my own primeng fork at: https://github.com/loicsalou/primeng.git branch "bugfix/tablerowexpansion-colreorder-issue" and launch showcase then check turbo table's expansion row demo to reproduce the issue.
Current behavior
when drag'n'dropping a column the resulting table is not correct: column is not at the correct place. Moving the last column, moving color before brand, produces an error (ERROR TypeError: Cannot read property 'header' of undefined).
Expected behavior
no error expected + dragged column should be placed at the drop position
Minimal reproduction of the problem with instructions
drag a column to a new position and check final order of columns, it's wrong
Problem analysis: easy to understand actually. The method "Table.onColumnDrop(event, dropColumn)" reorders the declared columns (for instance Vin, Year, Brand, Color) but the domHandler provides dragIndex and dropIndex from the dom and as I have setup a column for the toggle of expansion row I have 5 columns, not 4. So the columns involved in the reorder are not correct and if I move the last column (Color) I get the index 5 which does not exist in the declared columns).
I'm trying to find a solution which I can propose.
What is the motivation / use case for changing the behavior?
reorder is an important feature for my users
Please tell us about your environment:
MacOs or windows 7, Chrome (latest, Angular 5.2, prime 5.2.0-rc.3, node 8.4, npm 5.6.0)
Angular version: 5.2.0
the issue is definitely coming from Primeng
PrimeNG version: 5.2.0-rc.3
Browser: Chrome latest, Safari
Language: [all | TypeScript X.X | ES6/7 | ES5]
Typescript
Node (for AoT issues):
node --version
=The text was updated successfully, but these errors were encountered: