Closed shojibflamon closed 9 years ago
Solution pagination permission delete
// packages/mrjuliuss/syntara/assets/js/dashboard/permission.js previous code: }).on('click', '#delete-item', function() { $('#confirm-modal').modal(); }).on('click', '.delete-permission .confirm-action', function() { $.each($('.table tbody tr td input:checkbox:checked'), function( key, value ) { $.ajax( { "url": window.location.href.toString()+"/../permission/"+$(this).data('permission-id'), "type": "DELETE" }).done(function(result) { showStatusMessage(result.message, result.messageType); ajaxContent($(this).attr('href'), ".ajax-content", false); }); });
$('#confirm-modal').modal('hide');
})
replace code:
}).on('click', '#delete-item', function()
{
$('#confirm-modal').modal();
}).on('click', '.delete-permission .confirm-action', function()
{
// added by shojibflamon start
var getUrl = window.location.href.toString();
if(getUrl.match(/\?page=\d+/) !== null){
var modifiedUrl = getUrl.replace(/\?page=\d+/,"");
}else{
var modifiedUrl = getUrl;
}
// added by shojibflamon start
$.each($('.table tbody tr td input:checkbox:checked'), function( key, value )
{
$.ajax(
{
// "url": window.location.href.toString()+"/../permission/"+$(this).data('permission-id'),
"url": modifiedUrl+"/../permission/"+$(this).data('permission-id'),
"type": "DELETE"
}).done(function(result)
{
showStatusMessage(result.message, result.messageType);
ajaxContent($(this).attr('href'), ".ajax-content", false);
});
});
$('#confirm-modal').modal('hide');
})
Hi, this bug is fixed in this commit : https://github.com/MrJuliuss/syntara/commit/7ae394cd7d49871f035ab2688a9aaec84b70cf79
i do not release Syntara since this commit, i will do a release this evening with this fix ;)
Go to Permission go to next page then delete permission result: did not delete
but when i was in default permission page everything is ok