Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add eval readonly #81

Open
zonky2 opened this issue Jul 4, 2020 · 7 comments
Open

add eval readonly #81

zonky2 opened this issue Jul 4, 2020 · 7 comments
Labels
enhancement New feature or request
Milestone

Comments

@zonky2
Copy link
Contributor

zonky2 commented Jul 4, 2020

it´s possible to add attribute readonly?

e.g. for MetaModels/attribute_tabletext#7

see menatwork/MultiColumnWizard#214

@zonky2 zonky2 added the enhancement New feature or request label Jul 4, 2020
@zonky2 zonky2 added this to the 3.4.5 milestone Jul 4, 2020
@zonky2 zonky2 modified the milestones: 3.4.5, 3.4.x Sep 9, 2020
@Total-Reality
Copy link

It already works in Contao 4.9, MCW 3.4.9

@zonky2
Copy link
Contributor Author

zonky2 commented Jan 16, 2021

for all widgets?

@Total-Reality
Copy link

Total-Reality commented Jan 16, 2021

The question is which fields support this feature in Contao itself?
This is not clear @documentation https://docs.contao.org/dev/reference/dca/fields/#reference

I tested it with several field types.
It works with text, textarea, inputUnit and textStore.

It does not work with select, checkbox, imageSize, checkboxWizard, radio, pageTree, fileTree.
But I think this also does not work in Contao standard fields.

@zonky2
Copy link
Contributor Author

zonky2 commented Jan 16, 2021

Ahh! I thought about it again - I didn't mean readonly for the individual widgets, but readonly for the MCW. This of course includes that the individual widgets can be set readonly....

@Total-Reality
Copy link

Okay, I tested it. It works.
You can add new lines, but these won't be saved. This is the same procedure in several other Contao fields like inputType => list et cetera.

This is no bug imo.

@zonky2
Copy link
Contributor Author

zonky2 commented Jan 19, 2021

post your config...

@Total-Reality
Copy link

Btw. changes in existing lines won't be saved also.

$GLOBALS['TL_DCA'][$strTblName]['fields']['mcwtest222'] = array
(
    'exclude'   => true,
    'inputType' => 'multiColumnWizard',
    'eval'      => array
    (
        //'columnsCallback' => array('tl_mcw_test', 'getTestFields'),
	'readonly' => true,
        'columnFields' => array
        (
          'text' => array
          (
            'label'              => 'text',
            'default'            => 'Bla',
            'inputType'          => 'text',
            'eval'               => array('maxlength'=>5, 'style'=>'width:50px') //, 'nospace'=>true, 'trailingSlash'=>true
          )
      ),
    ),
    'sql'       => "blob NULL"
);

@zonky2 zonky2 modified the milestones: 3.4.x, 3.5.x Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants