ratiw / vuetable-2-tutorial

MIT License
258 stars 67 forks source link

How to use "transform" data from e.g. a POST request or WebSocket (valid next_page_url and prev_page_url aren't possible) #115

Closed pmorch closed 5 years ago

pmorch commented 5 years ago

Newbie: I'm struggling a little with how to hook up the transform hook if next_page_url and prev_page_url don't make sense for our app.

For the sake of argument, lets say that in our application we need to perform a POST request, or send something to a WebSocket and wait for a response, call a JavaScript API or perform two AJAX requests and merge them, or use a web worker somehow, or you-name-it....

Is it possible for vuetable-2 to call a JavaScript method that I provide when it wants next/previous/PageN data so I myself can query and return a promise to that data (or equivalently provide a callback that we later can call when we have the data)?

I don't want vuetable-2 to try to request the data from some URL by itself, because that requires intricate knowledge of our app. (Sure I could refactor our app to suit the vuetable-2 expectations, but I'd rather not)

pmorch commented 5 years ago

Sorry, posted in the wrong project...