Search code examples
internet-explorerbackbone.jsbackbone-views

Backbone js model is not getting removed from the collection in IE browser


I am displaying the list of TODO's on a screen which is nothing but a collection. user can add/update/delete any particular model from the list. Problem is:


  • When user deletes all the models from the collection and only last model is remaining into that collection.
  • User chooses 'Delete'.
  • The last model also gets removed from the collection and also from the database at server side.
  • But the last model still displays on UI list.
  • This is happening only on IE browser.
  • What should I do so that after removing last model from the collection I can see an empty list.

Please need help.


Solution

  • I found the solution for this. I have to clear the cache each time I cleared the last model from list. So I have added the ajax code for clearing the cache

    $.ajaxSetup({ cache: false });