Skip to content
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

groupBy live reloading? #1

Open
kcollignon opened this issue Apr 17, 2015 · 5 comments
Open

groupBy live reloading? #1

kcollignon opened this issue Apr 17, 2015 · 5 comments

Comments

@kcollignon
Copy link

I was wondering if it would be possible to use the group by functionality and have it automatically update its content when a new model gets added to the store?

@HeroicEric
Copy link
Owner

Can you provide an example of what you mean?

@kcollignon
Copy link
Author

@HeroicEric sure! I should've included that in the original writeup.

I have a grouped list...

screen shot 2015-04-21 at 10 22 51 am

When I create a new record, it does not automatically get added to the list. I must refresh the page in order to see the new grouped record appear.

This is the code in my ArrayController:

documentFormatsByCategory: groupBy('model', 'category')

@HeroicEric
Copy link
Owner

Hmm. How are you creating the new record?

@kcollignon
Copy link
Author

I have an action in my controller that creates it using Ember data and form fields.

actions:
    createDocumentFormat: ->
      fields = @get('fields')
      fields.organization_id = @get('controllers.application.selectedOrgId')
      fields.category = @get('selectedDocumentFormatType')
      format = @store.createRecord 'document_format', fields
      format.save().then (format) =>
        @transitionToRoute 'document_formats'

@roncodes
Copy link

I need this as well, any update on how to accomplish this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants