Skip to content

Datatable wrong data-field-name if field name with key, and data dont save  #117

@Trysystems

Description

@Trysystems

Datatable widget generates wrong attribute data-field-name. In my case, I extend form with fields with keys (data[1][row], data[2][row]), and widget generates name "Report[data[1][row]]". It's because of logic on 155 string at DataTable.php file.

Temporary fix it with change string to
$config->fieldName = $this->getParentForm()->arrayName.'['.implode('][', HtmlHelper::nameToArray($this->fieldName)).']';

I took logic from FormField class.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs responseIssues/PRs where a maintainer is awaiting a response from the submitterstaleIssues/PRs that have had no activity and may be archived
    No fields configured for Unconfirmed Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions