Adding object to a Collection in the first position with backbone?

后端 未结 1 928
再見小時候
再見小時候 2021-01-23 08:50

I have this simple function to add a Folder to a collection called \'Folders\'.

folderAdded: function(folder) {
            this.folders.add(folder);
                    


        
相关标签:
1条回答
  • 2021-01-23 09:31

    You can use unshift method of the collection.

    Add a model at the beginning of a collection. Takes the same options as add

    0 讨论(0)
提交回复
热议问题