[FIX]Fix the issue of page navigation when all records of current page are deleted, currently it does not go to previous page instead displays blank list, expected behavior: it should navigated to previous page when all records of the current page deleted.
bzr revid: msh@openerp.com-20131017130217-dtpukpq27fdmsvd9
This commit is contained in:
parent
436a849b2e
commit
e578e2af78
|
@ -593,7 +593,13 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
|
|||
_(ids).each(function (id) {
|
||||
self.records.remove(self.records.get(id));
|
||||
});
|
||||
self.configure_pager(self.dataset);
|
||||
if (self.records.length == 0 && self.page > 0) {
|
||||
//Trigger previous manually to navigate to previous page,
|
||||
//If all records are deleted on current page.
|
||||
self.$pager.find('ul li:first a').trigger('click');
|
||||
} else {
|
||||
self.configure_pager(self.dataset);
|
||||
}
|
||||
self.compute_aggregates();
|
||||
});
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue