lundi 7 avril 2014

Grouped list, add a record with same ID but different group.

Given a list grouped by property "type", ordered by property type and id.



My store contains




Code:



{id:1,name:'Peter',type:'Person'}

{id:2,name:'Alex',type:'Person'},

{id:3,name:'Count Dracula',type:'Unperson'}



The result is the list




Code:



Person

o Peter

o Alex

Unperson

o Count Dracula



I add a record to that store:




Code:



{id:2,name:'Alex',type:'Unperson'}


I would expect:




Code:



Person

o Peter

Unperson

o Alex

o Count Dracula



but I get




Code:



Person

o Peter

o Alex

Unperson

o Count Dracula



Let's now reload the same store with the following data:




Code:



{id:1,name:'Peter',type:'Person'}

{id:2,name:'Alex',type:'Unperson'},

{id:3,name:'Count Dracula',type:'Unperson'}



I now add to the store:




Code:



{id:2,name:'Alex',type:'Person'}


I would expect:




Code:



Person

o Peter

o Alex

Unperson

o Count Dracula



but I get




Code:



Person

o Peter

Person

o Alex

o Count Dracula



Is this behaviour indended, or what did I overlook?




Aucun commentaire:

Enregistrer un commentaire