Opened 9 years ago

Closed 9 years ago

#14291 closed (duplicate)

In django admin results list, provide the field name as a css class on the table cell

Reported by: vjimw Owned by: nobody
Component: Contrib apps Version: 1.2
Severity: Keywords: admin css class field
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


I have found it useful a number of times to use jQuery or other methods to directly reference a piece of content in an admin list. This would be much easier if I could address each table cell by the field name with a CSS class. I have modified the file and attached a patch.

Here is an example of an updated table row the field names as the CSS class on each cell.

<tr class="row1">
  <td class="action_checkbox"><input type="checkbox" class="action-select" value="13106" name="_selected_action" /></td>
  <th class="offer_code"><a href="13106/">CJTAKE10</a></th>
  <td class="legal_site"></td>
  <td class="created_by">User: medv12 (Medv12 Legal)</td>
  <td class="copyright_or_trademark">CP</td><td class="store">Halloween Express</td>
  <td class="current_state">Found - 2010-09-14</td><td class="overdue">(None)</td>

By adding the CSS class, I can easily extend the admin functionality with Javascript (or a JS library)

Attachments (1) (3.9 KB) - added by vjimw 9 years ago. patch to add CSS classes for each table cell based on the file field

Download all attachments as: .zip

Change History (3)

Changed 9 years ago by vjimw

Attachment: added patch to add CSS classes for each table cell based on the file field

comment:1 Changed 9 years ago by Daniel F Moisset

Triage Stage: UnreviewedAccepted

comment:2 Changed 9 years ago by Julien Phalip

Resolution: duplicate
Status: newclosed

Dupe of #11195.

Note: See TracTickets for help on using tickets.
Back to Top