-
Notifications
You must be signed in to change notification settings - Fork 15
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
Using ember-yeti-table with the model() hook and queryParams #406
Comments
All this addon requires for async loading is a function that returns a promise with data. The component will call the provided function when needed. Unfortunately, this doesn't play very well with the model hook + query params way of loading data. Because, as I've said, YetiTable expects to be driving the data loading through a single Passing in
With this you could do something like: <YetiTable
@processedData={{this.model}}
@onPageChange={{fn (mut this.page)}}
@onFilterChange={{fn (mut this.search)}}
... where This functionality doesn't exist at the moment. Not for any particular reason. I think no one simply needed it until now. :) I'll leave this ticket open. It doesn't seem like a too complicated feature to implement. It's basically making sure YetiTable also works in "dumber" scenarios (dumber in the sense that YetiTable does less things). |
I think the route model hook is really more for the initial data, and changing data is controlled by the controller. Thats why at this time the query params are on the controller not the route. If your yeti table is on the controller template you shouldnt have a problem. If your table is in a component, then yea you need some communication back and forth. Routeable components was a direction ember was going at one time, doing away with controllers, and have removed all the obstacles but one, query params were only accessible from the controller. :( Adding the additional actions would probably be useful, although increasing the API surface and complexity. I am waiting on the following RFCs to land |
This is similar to the issue I created a couple of years ago: #18 But I probably didn't explain it well enough 😄. |
It some recent work I have done with replacing ember-crumbly, I see query params are already accessible in the router service, just cant be updated there yet, but read-only is what we need. Will see if I can find some time to see what might be done here |
Big fan of this addon. I love the template-based approach you've taken, and it's one of the only Ember table addons I've found that allows for template-based HTML table cell content while retaining sort functionality. My issue is as follows:
I'm trying to follow Ember's data flow guidelines to a T, but I'm having an incredibly hard time integrating this addon while adhering to said guidelines. I have a dataset with 10,000+ records, and as such I have no choice but to use server-side pagination. My table data originates from the route
model()
hook, and page/filter/sort changes are bound toqueryParams
withrefreshModel: true
so themodel()
hook can be notified to fetch a new set of data.Here are my requirements for this addon:
model(params)
)In this addon's current state, is this kind of functionality possible? It's almost like I need to use
@data
to populate the table with data frommodel()
, and then use@loadData
to listen for page/filter/sort changes in order to updatequeryParams
.I see that actions are exposed via
table.actions
, however is this not the reverse of how things are supposed to work? As I understand it, we call these actions from a parent context to call internal actions inside<YetiTable>
. But doesn't this design violate DDAU? Or am I misunderstanding something/behind the curve of how things are done in 2021?Again, huge fan of this addon. I'm just struggling mightily trying to incorporate this table component into my large app while adhering to Ember's recommended way of doing things. Any information is appreciated. Thank you.
The text was updated successfully, but these errors were encountered: