Action column toggle behavior changed
See original GitHub issueIn version 1.1.0 and prior, I was able to toggle the entire action column on and off using this code:
tableSettings = {
actions: {
add: false,
edit: false,
delete: false
}
}
deleteToggle () {
const changeDelete = Object.assign({}, this.tableSettings)
changeDelete.actions.delete = !changeDelete.actions.delete
this.tableSettings = Object.assign({}, changeDelete)
}
As of version 1.2.0, this behavior has changed - if the settings object has delete: true
when the page loads, toggling it will remove the delete links but leave behind an empty column, while if it starts with delete: false
, toggling it does nothing visible at all.
This seems to be related to the performance improvements in 69e883c - I was able to get it partially working by rolling back some of the changes in thead-titles-row.component.ts - but I’m not sure what the best way to handle it would be.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
Toggling Stretch Column Widths in an Interactive Grid
To change the behavior of interactive grid column widths: Click Actions and select Format. If there is a checkmark next to Stretch Column...
Read more >How to toggle ExtJs grid action column icon and tooltip?
I need to toggle Action column icons and tooltip. I have 2 images for Play and Pause (play-icon.png and pause-icon.png) I want to...
Read more >Toggles - Selection and input - Human Interface Guidelines
Use a toggle to help people choose between two opposing values that affect the state of content or a view. A toggle always...
Read more >Actions: The Essentials - AppSheet Help - Google Support
All actions have configurable behavior options that control which rows to display the action and whether or not it requires confirmation before being...
Read more >Demo: Using Actions to Change Column Values - YouTube
We make an app about apples with Spec. In the demo, we show how to use conditional formatting to customize the app. We...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So, I poked around a bit more and found that in the new version, you can import the Ng2SmartTableComponent and call the initGrid() function on it. This will redraw the grid entirely with all of your settings changes. I had previously copied the repo and exposed it this myself, but when I saw the newest version of ng2-smart-table, I found that most of my customization issues had been addressed, so I just started using the new version. This was the last issue I was trying to recreate, so I’m really glad that initGrid() is exposed now. Here is an example: smart-table.component.ts … import { Ng2SmartTableComponent } from ‘ng2-smart-table/ng2-smart-table.component’; … toggleEditMode( table: Ng2SmartTableComponent ) { if ( this.editing ) { this.settings.actions = { add: false, edit: false, ‘delete’: false, }; this.settings.columns = this.columns; } else { this.settings.actions = { add: true, edit: true, ‘delete’: false, }; this.settings.columns = this.editingColumns; } table.initGrid(); this.editing = !this.editing; } …
smart-table.component.html … <ng2-smart-table #table [settings]=“settings” [source]=“source” (deleteConfirm)=“onDeleteConfirm($event)”> </ng2-smart-table> …
hope this helps folks out some.
@jkon Thanks for finding that! I think at this point we’re committed to staying with 1.1.0 for this release, but hopefully that’ll be useful in the future.