Pulled a little of what's left of my hair out with this little gotcha looking at an issue with Umbraco. I was looking to add a small feature to allow you to re-order a list. Umbraco (version 7) uses angularjs in the back-office. Updating this controller and view code was very straightforward to add a couple of buttons to move the list items up and down. However although I could see the order was properly being saved to the database, the retrieved list remained in the order that the items were created. Using the Chrome console network tab I could see that the JSON response was coming back from the server in the correct order: ... key":"items","value":{"10":"aaa","7":"bbb","8":"ccc"} ... However as soon as this materialised in code, the order was lost: ... key":"items","value":{"7":"bbb","8":"ccc","10":"aaa...
Senior Developer and head of DXP at Umbraco. Previously with Zone, building solutions primarily on .NET and using Umbraco, EPiServer and Sitecore CMS. This blog is used as a repository for various tips, tricks, issues and impressions drawn from the use of technology my work and interests. All words are my own.