ember-group-by icon indicating copy to clipboard operation
ember-group-by copied to clipboard

groupBy live reloading?

Open kcollignon opened this issue 9 years ago • 5 comments

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?

kcollignon avatar Apr 17 '15 00:04 kcollignon

Can you provide an example of what you mean?

HeroicEric avatar Apr 21 '15 17:04 HeroicEric

@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')

kcollignon avatar Apr 21 '15 17:04 kcollignon

Hmm. How are you creating the new record?

HeroicEric avatar Apr 21 '15 19:04 HeroicEric

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'

kcollignon avatar Apr 21 '15 19:04 kcollignon

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

roncodes avatar Sep 13 '17 01:09 roncodes