-
-
Notifications
You must be signed in to change notification settings - Fork 365
fix(Table): reset columns after toggle visible (#7180) #7186
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,4 +1,4 @@ | ||||||
| export { getResponsive } from '../../modules/responsive.js' | ||||||
| export { getResponsive } from '../../modules/responsive.js' | ||||||
| import { copy, drag, getDescribedElement, getOuterHeight, getWidth, isVisible } from '../../modules/utility.js' | ||||||
| import '../../modules/browser.js' | ||||||
| import Data from '../../modules/data.js' | ||||||
|
|
@@ -180,6 +180,13 @@ export function resetColumn(id) { | |||||
| } | ||||||
| } | ||||||
|
|
||||||
| export function resetColDragListener(id) { | ||||||
| const table = Data.get(id) | ||||||
| if (table) { | ||||||
| setDraggable(table) | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| export function bindResizeColumn(id) { | ||||||
| const table = Data.get(id) | ||||||
| if (table) { | ||||||
|
|
@@ -924,6 +931,8 @@ const setDraggable = table => { | |||||
| let index = 0 | ||||||
| table.dragColumns = [...table.tables[0].querySelectorAll('thead > tr > th')].filter(i => i.draggable) | ||||||
| table.dragColumns.forEach(col => { | ||||||
| disposeDragColumns(col); | ||||||
|
||||||
| disposeDragColumns(col); | |
| disposeColumnDrag([col]); |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8476,6 +8476,8 @@ public async Task AllowDragColumn_Ok() | |||||
| { | ||||||
| pb.Add(a => a.RenderMode, TableRenderMode.Table); | ||||||
| pb.Add(a => a.AllowDragColumn, true); | ||||||
| pb.Add(a => a.ShowToolbar, true); | ||||||
| pb.Add(a => a.ShowColumnList, true); | ||||||
| pb.Add(a => a.ClientTableName, "table-unit-test"); | ||||||
| pb.Add(a => a.OnQueryAsync, OnQueryAsync(localizer)); | ||||||
| pb.Add(a => a.OnDragColumnEndAsync, (fieldName, columns) => | ||||||
|
|
@@ -8490,9 +8492,14 @@ public async Task AllowDragColumn_Ok() | |||||
| builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string))); | ||||||
| builder.CloseComponent(); | ||||||
|
|
||||||
| builder.OpenComponent<TableColumn<Foo, string>>(0); | ||||||
| builder.AddAttribute(3, "Field", "Address"); | ||||||
| builder.AddAttribute(4, "FieldExpression", Utility.GenerateValueExpression(foo, "Address", typeof(string))); | ||||||
| builder.OpenComponent<TableColumn<Foo, string>>(3); | ||||||
| builder.AddAttribute(4, "Field", "Address"); | ||||||
| builder.AddAttribute(5, "FieldExpression", Utility.GenerateValueExpression(foo, "Address", typeof(string))); | ||||||
| builder.CloseComponent(); | ||||||
|
|
||||||
| builder.OpenComponent<TableColumn<Foo, int>>(6); | ||||||
| builder.AddAttribute(7, "Field", foo.Count); | ||||||
|
||||||
| builder.AddAttribute(7, "Field", foo.Count); | |
| builder.AddAttribute(7, "Field", "Count"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after assignment operator. Should be
_resetColDragListener = false;instead of_resetColDragListener= false;