javascript - browser crashes after a few pagination applied in pageable collection -


i working backbone pageable collection extends backbone collection.

i have paginator can move our pages in came pageable collection.

i working upon server side mode of backbone pageable collection.

the problem when paginate 5-6 times paginator. chrome crashes increases memory storing current collection. , perhaps not destroying stored collection.

i doing following solve problem :

this.collection.getpage(pageno).success(function(result) {               this.collection.remove();             }); 

i expecting this.collection.remove() clear memory used. doesn't. above not solve problem.

has find problem earlier? how did solved problem?

it's hard without seeing paginator's code. anyway, first of calling this.collection.remove() nothing without passing argument model or array of model (see official documentation).

so suggest instead (assuming result contain valid array of models)

this.collection.getpage(pageno).success(function(result) {     this.collection.reset(result); }); 

calling reset replace collection's models new ones. again, find out more, read documentation!


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -