Lists - uncheck all checkboxes


I couldn’t find on how to uncheck all checkboxes in a _list_toolbar.htm controller with JS.

I genereate a PDF to download with some data of the list entries and after the generation of the PDF I want to disable the delete entries button and I want everything to be unchecked again:

function handleDownloadPdfSuccess(data, textStatus, jqXHR) {
    if (jqXHR.deleteJobPdf) {
        // try to disable delete button with added class (doesn't work)
        $('.toolbar-button-delete').attr('disabled', true);

        //  try to uncheck head checkbox and all list checkboxes  (doesn't work)

        //  disable PDF generate button and add link to PDF (works)
        $('#generate-delete-application').attr('disabled', true);
        $('#download-delete-application-pdf').removeAttr('disabled').attr('href', jqXHR.deleteJobPdf);
    } else {
        // TODO: make error flash

I call handleDownloadPdfSuccess with a button data-request-success="handleDownloadPdfSuccess".

Someone knows how to do that?


doesnt help with this situation?


in your script in controller action

return $this->asExtension('ListController')->listRefresh();

Probably something like this

$('.control-list .list-checkbox input[type="checkbox"]')
    .prop('checked', false)
1 Like