DrQuincy Posted Monday at 11:02 AM Posted Monday at 11:02 AM Let's say I have Fieldset Group called Tables that contains 3 x Pro Fields table. Each table is label, value where label is set via the API and is readonly (see below). If I set the field to be Closed on load, how can I set it so that if in any of the tables if value is empty instead of seeing a closed fieldset: Tables ... I get something like: Tables ... 7 missing values or Tables (7 missing values) ... (either is okay) Additional questions: I also want to hide the new row button but I think I can easily do that with CSS. Use this CSS: li#Inputfield_{myFieldName}pageText a.InputfieldTableAddRow { display: none; } How can I make the label field in the table readonly, add readonly=readonly to the settings for that column doesn't do it. Use this JS: $('input.{myFieldName}-label').attr('readonly', 'readonly').attr('onfocus', 'this.blur()').css('opacity', 0.6); How to sort the table A to Z by label Didn't realise there is a setting for this, great! Thanks. EDIT: Here's how I did it: \ProcessWire\wire()->addHookAfter('ProcessPageEdit::buildForm', function(\ProcessWire\HookEvent $event) { $object = $event->object; $form = $event->arguments('form'); $page = $object->getPage(); $page->of(false); if ($page->myField) { $toAction = 0; foreach ($page->$myField as $row) { if (!$row->value) { $toAction ++; } } if ($toAction > 0) { $form->prependMarkup('<div class="pw-container uk-container uk-container-expand"><div class="uk-alert uk-alert-danger"><span class="fa fa-exclamation-circle"></span> Check the <strong>Page text</strong> tab; ' . (int) $toAction . ' value(s) needs entering</div></div>'); } } });
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now