Skip to content

Commit

Permalink
refresh-table
Browse files Browse the repository at this point in the history
  • Loading branch information
karandatwani92 committed May 24, 2024
1 parent 5262906 commit 3d375e0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/resources/views/crud/buttons/quick.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
if($ajax_enabled) {
$wrapper['data-route'] = $wrapper['href'];
$wrapper['data-method'] = $button->meta['ajax']['method'] ?? 'POST';
$wrapper['data-refresh-table'] = $button->meta['ajax']['removesEntryFromTable'] ?? false;
$wrapper['href'] = 'javascript:void(0)';
$wrapper['onclick'] = 'sendQuickButtonAjaxRequest(this)';
Expand Down Expand Up @@ -67,12 +68,14 @@
$("[data-button-type=quick]").unbind('click');
function sendQuickButtonAjaxRequest(button) {
// e.preventDefault();
var route = $(button).attr('data-route');
$.ajax({
url: route,
type: $(button).attr('data-method'),
success: function(result) {
if($(button).attr('data-refresh-table') && typeof crud != 'undefined' && typeof crud.table != 'undefined'){
crud.table.draw(false);
}
new Noty({
type: "success",
text: result.message?result.message:'<strong>'+$(button).attr('data-success-title')+'</strong><br>'+$(button).attr('data-success-message'),
Expand Down

0 comments on commit 3d375e0

Please sign in to comment.