Sha256: a4da21963cb1c9bbc2bbbe55a59916194bdacc0ea6acd01cb85b946ee2c4c0af
Contents?: true
Size: 1.1 KB
Versions: 50
Compression:
Stored size: 1.1 KB
Contents
$.fn.bulkRowEdit = function() { var applyAction = function() { $('[type=submit][data-bulk-row-edit]').prop('disabled', true); var ids = []; $('input[type=checkbox][data-bulk-row-edit]:checked').each(function() { ids[ids.length] = $(this).data('bulk-row-edit'); }); var action = $('select[data-bulk-row-edit]').val(); if (ids.length == 0) { alert('No rows are selected to be modified!'); $('[type=submit][data-bulk-row-edit]').prop('disabled', false); return false; } $.ajax({ url: $('form[data-bulk-row-edit]').attr('action'), type: 'PATCH', data: { bulk_action: action, bulk_ids: ids } }).done(function() { window.questionnairesDataTable.draw(false); }).fail(function() { alert("Request failed, please refresh the page or try again later."); }).always(function() { $('[type=submit][data-bulk-row-edit]').prop('disabled', false); }); return true; }; $('[type=submit][data-bulk-row-edit]').on('click', function(e) { e.preventDefault(); return applyAction(); }); };
Version data entries
50 entries across 50 versions & 1 rubygems