Skip to content

Problems with django-smart-select #168

@thejpanganiban

Description

@thejpanganiban

Additional class=chained-fk and data-* attributes from the widget ChainedSelect (https://github.com/jazzband/django-smart-selects/blob/master/smart_selects/widgets.py#L54) does not render. They're needed attributes so bindfields.js would work properly.

Tried @Thutmose3's branch (#163) as well, with no luck.


Here's what I understand so far:

  1. ChainedSelect widget generates attributes (class=chained-fk, and some data-attributes) that's later picked-up by the jQuery functions of django-smart-select.
  2. Widget attributes for some reason does not render in the template when using django-crispy-forms + tailwind.
  3. Found out that attributes are generated differently on <select>: field|build_attrs vs {% include "tailwind/layout/attrs.html" ... %}.
  4. Replaced tailwind/layout/select.html so that it uses Django's original template (plus some modifications so that variables match), and additional attributes are still not rendering.

Where could the attributes from ChainedSelect have gone?

cc: @RJAA-25

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions