question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Optionally prevent <b-table>'s "sort-changed" event from triggering provider function

See original GitHub issue

Let me start out by saying a huge thank you for the efforts on this package. I am a few days in the weeds with this issue, so if there’s something simple I’m overlooking, I do apologize for the noise, and please feel free to point me in the correct direction.

Is your feature request related to a problem? Please describe…

In order to handle deeply nested links, I am triggering a $router.push() when the sort direction is changed via a listener on @sort-changed. Additionally, I am watching the $route object on the parent component and refreshing the table when $route changes.

I’d like some way to prevent the sorting-changed event from triggering the provider method, because this leads to duplicate provider calls, once when the event triggers, and once when the route changes, calling the vm.watch() method which refreshes the table.

Describe the solution you’d like

Some mechanism to determine what event triggered the provider call: perhaps either an event modifier (e.g. @sort-changed.prevent) or an additional context prop or a parameter passed to the data provider function itself.

Describe alternatives you’ve considered

I’ve also considered syncing the sort props on the parent component and then checking in the callback function mapped to the @sort-changed event to see if the values match the context object, but it appears at first glance the synced props are already mutated by the time that event fires.

Additional context

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
jahsomecommented, Jul 9, 2019

Right-o. Had hoped to avoid as much custom implementation as possible, as for 90% of my use case, things are covered.

0reactions
tmorehousecommented, Jul 9, 2019

Yeah if the sort params are initially set.

We’ll close this for now (but it can still have conversations). If you find/discover anything else let us know.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Table | Components - BootstrapVue
Table. For displaying tabular data, <b-table> supports pagination, filtering, sorting, custom rendering, various style options, events, and asynchronous ...
Read more >
How to listen sortChange(event) on Angular for ag-Grid?
It is sortChanged and not sortChange (has a d). Try: printSortStateToConsole() { const sortState = this.gridApi.
Read more >
bootstrap-vue - UNPKG
Prop values\n * are also cloned as new references to prevent possible mutation of original\n * prop object values. Optionally accepts a function...
Read more >
onSortChanged - Sort Changed Action - HCL Product Documentation
Activates an event handler when a sort key is going to be changed.
Read more >
Ext.grid.column.Column | Ext JS 6.7.0 - Sencha Documentation
By default, when the alignTo method is called, a floating component will scroll to keep aligned with the anchoring element if the anchoring...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found