Forums

Help with Multicheck field in admin UI


LaocheXe » 6 months ago
Based off of: https://www.e107sk.com/documentation/admin-ui-stuff/?cat.110#multicheckbox-field


Code Used:
Spoiler:

Basically service record area of the plugin I am working on (for a type of clan/roster system) - got a section to give users qualifications - so the dropdown multicheck list will display the Qualifications, and assign each one to the selected user. However, when editing a user in the service records, it's a regular dro down list,, that only shows number 1.

Inline edit is true, but it displays nothing to edit on the list of current users in the service records.

This is the plugin: https://github.com/LaocheXe/RSystems/tree/master/roster

Right now the qualifications have been set in another db table - but want to get rid of that - tried setting up this same method last year but ran into the issue of hard coded userclasses tree.


LaocheXe
Level 1

Jimako » 6 months ago
It's hard without data.

If you debug dropdown field, you should do this:

1. try it with hardcoded list of options
for example:

$this->fields['qual_id']['writeParms']['optArray'] = array('element_setting_0','element_setting_1', 'element_setting_2');

if everything works, then you can try normal dropdown from database.

2. replace by data from database
$rows = e107::getDB()->retrieve("qualifications_sys", "*", true, true);
      foreach($rows as $qua) {
        $this->qualsys[$qua['qual_id']] = $qua['qual_name'];
      }
			$this->fields['qual_id']['writeParms']['optArray']  = $this->qualsys;

And only if everything works, add multicheck

3. add multicheck

'writeParms' => array('multiple'=> 1 ),

Not tested readmode without data.


JMadmin

Jimako
Main Admin
JMadmin

LaocheXe » 6 months ago
Thanks, that worked. Must have been my array/query


LaocheXe
Level 1

Moderator(s): Jimako, kreossino

Latest Downloads

e107 version 2.3.0 from 17.03.2020
in Category: Stuff in development

e107 version 2.3.0 from 17.03.2020

2 weeks ago

e107 CMS downloaded from Github 17.03.2020 - called 2.3.0.0 - deleted e107 tests - deleted Voux and Landing Zero themes. This pack is for users that are working with our themes. Stable version 2.2.1 i 
Read more..

e107 version 2.3.0 from 17.03.2020
JM Download plugin 1.2
in Category: JM Download plugin

JM Download plugin 1.2

1 month ago

Plugin for extending the core Download plugin. Version 1.3 on Github Replaced JM_Download plugin, Latest Releases by Father Barry,  Top Downloads menu by SecretR, AACGC Download Tracker by M@CH!N3 Ver 
Read more..

JM Download plugin 1.2
JM Core plugin 1.6.0
in Category: e107 plugins

JM Core plugin 1.6.0

3 months ago

The version used on this site. It fixes some core limitation via the plugin, no core changes. Check Readme at first.  Version 1.6.1 on github What is inside? - fix for missing titles in the main me 
Read more..

JM Core plugin 1.6.0