-
-
Notifications
You must be signed in to change notification settings - Fork 121
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
Dynamically adding column(s) is causing row move feature stop #1018
Comments
The reason is because the Row Move is a special columns that is being pushed to the column definitions array and is not directly accessible from your Anyway long story short, you need to access that Angular-Slickgrid copy of all column definitions and use that one instead of your - this.columnDefinitions.splice(0, 0, newCols[0], newCols[1]);
- this.columnDefinitions = this.columnDefinitions.slice(); // or use spread operator [...cols]
-
+ const cols = this.angularGrid.gridService.getAllColumnDefinitions();
+ cols.splice(0, 0, newCols[0], newCols[1]);
+ this.columnDefinitions = cols.slice();
+ // or use SlickGrid setColumns directly
+ // this.angularGrid.slickGrid.setColumns(cols); Also note that there are a couple more special columns, basically any of the columns that are added dynamically by the lib,
I added a troubleshooting section in the Row Selection & Row Detail Wiki Adding a Column dynamically is removing the Row Selection, why is that? |
I'm reopening this issue, I currently have a POC that does keep the user's column definitions in sync as well, however there will be a slight change on the user's side for this to work, the change is to use <angular-slickgrid gridId="grid17"
- [columnDefinitions]="columnDefinitions"
+ [(columnDefinitions)]="columnDefinitions"
[gridOptions]="gridOptions"
[dataset]="dataset"
(onAngularGridCreated)="angularGridReady($event.detail)">
</angular-slickgrid> |
- for some extensions/plugins, that is RowDetail, RowMove, RowSelections, are adding extra columns dynamically when the grid is created and are not synced to the user, this PR will help with that but has to be implement differently in each lib wrappers (Angular, Aurelia, ...) - closes issue #1018
Describe the bug
I'm trying to use both
And when I add a column, the column with burger buttons to enable rowmove dissapears
Reproduction
I have reproduced the case in
Example 17: Row Move & Checkbox Selector
Which has row move already activated
I have change the code in
To add the columns
Environment Info
Validations
The text was updated successfully, but these errors were encountered: