Skip to content

TABLE::OPT_ATTRIBUTES not working #36

@dowitsch

Description

@dowitsch

I was trying to add a attribute to the table with:

$table->setOption(Table::OPT_ATTRIBUTES, ['data-controller' => 'default-batch-select']);

Unfortunately this does not work. For me it looks like this is a problem with the new table template.

The old table template had a function implemented to add the attributes:

# vendor/araise/table-bundle/src/Resources/views/_old/_table.html.twig

    <table {{ macros.attributes(contentAttr) }}>
        <thead class="thead-default">
        {% include '@araiseTable/_head.html.twig' %}
        </thead>
        <tbody>
        {% include '@araiseTable/_content.html.twig' %}
        </tbody>
    </table>

the new tailwind template has nothing like this:

# vendor/araise/table-bundle/src/Resources/views/tailwind_2/_table.html.twig

    <table
        class="min-w-full bg-white" {{ stimulus_target('araise/table-bundle/table', 'table') }} {{ stimulus_target('@araise/table-bundle/table_select', 'table') }}>

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