Skip to content

Instantly share code, notes, and snippets.

@marti1125
Created March 16, 2014 01:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marti1125/9577017 to your computer and use it in GitHub Desktop.
Save marti1125/9577017 to your computer and use it in GitHub Desktop.
get las page when delete rows
$(document).on("click",
"#deleteSelection${cadenaAleatoria}",
function(){
$('.alertaGrillaResultado').css('display','inherit');
var selectedModels = grid.getSelectedModels();
if(selectedModels != ''){
var respuesta = confirm('¿Desea retirar Horas de Equivalencia?');
if(respuesta){
_.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 la Hora de Equivalencia seleccionada" + '</div>'
);
});
//recargarGrid();
}
//alert("mi pagina "+collection.state.currentPage)
//alert("ultima pagina "+collection.state.lastPage)
if(collection.state.lastPage < collection.state.currentPage){
collection.getLastPage();
}
/*if(collection.state.totalPages){
collection.getLastPage();
}
*/
//alert(collection.state.lastPage)
//alert(collection.state.totalPages);
//
//collection.getPage(collection.state.currentPage)
//alert(collection.state.currentPage)
$('.alertaGrillaResultado').fadeOut(6000);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment