jeudi 27 février 2020

Django 2.2 How to disable checkboxes in list view

Django 2.2

I have a list view controlled by admin.py class. No custom template, all default. I can control what fields from the table should be shown in the view with this: fields = ('myfield1','myfield2', ...).

Each row in the list table has a checkbox in the first column:

    <td class="action-checkbox">
      <input type="checkbox" name="_selected_action" value="123" class="action-select">
    </td>

My questions are:

  1. How to disable those checkboxes ?

  2. Can it be done for SOME of the checkboxes (let's say I have a list of pk ids for the rows I don't want to see checkboxes.)




Aucun commentaire:

Enregistrer un commentaire