骨干可分页,当我删除最后一行页面时

时间:2014-01-23 20:00:36

标签: javascript backbone.js backgrid

我正在使用此代码删除行

$(document).on("click",
"#deleteSelection${cadenaAleatoria}",
function(){

$('.alertaGrillaResultado').css('display','inherit');
 var selectedModels = grid.getSelectedModels();

 if(selectedModels != ''){
_.each(selectedModels, function (model) {
  model.trigger("backgrid:select", model, false);
  var id = grid.collection.fullCollection.where({ id: model.id });
  grid.removeRow(id);
  $.get("@{delete()}/" + model.id, function (modelos) {
  });
  $('.alertaGrillaResultado').html(
        '<div class="alert alert-success">' + '<button type="button" class="close"      data-dismiss="alert">&times;</button>' + "Se retiro el Tipo de Eventualidad seleccionada" + '</div>'
    );
});
collection.fetch({reset:true});



  }

$( 'alertaGrillaResultado')淡出(3000)。      });

但是当我删除一页的最后一行时 我收到这个错误:

抛出新的RangeError(“currentPage必须是firstPage&lt; = currentPage”+                                (firstPage?“&gt;”:“&gt; =”)+                                “totalPages if”+ firstPage +“ - based。得到了”+                                currentPage +'。');

如何更新分页?如何解决这个问题?

0 个答案:

没有答案