I have two fields defined as render.ClickCrossTick in the overview of a MigxDb as shown in the screenshot.
The one with the fieldname “published” works as great. Clicking it’s green checkmark toggles to a red cross and vice versa.
However, the field “published_footer” ignores the clicks.
it seems that the purpose of render.ClickCrossTick is indeed only to publish/unpublish an object (handler = 'this.publishObject' | handler = 'this.unpublishObject').
Maybe you can use this.renderSwitchStatusOptions instead. Fill out the “Renderoptions” (at the bottom of the form) and I believe you also have to activate this.handleColumnSwitch (in the tab “Handlers”) to make it work.
Is there any documentation anywhere on what exactly one needs to do in MIGX to use “this.renderSwitchStatusOptions” for a click toggle with checkbox/ X?
I can’t find any guidance anywhere. Most googling of that term turns up a lot of Russian
name: checkbox_inactive value: 0 image: assets/components/migx/style/images/cb_empty.png
name: checkbox_active value: 1 image: assets/components/migx/style/images/cb_ticked.png
and as fallback for other values:
name: checkbox_fallback check the ckeckbox: ‘use as fallback’ value: image: assets/components/migx/style/images/cb_empty.png
at the Tab ‘Handlers’ check ‘this.handleColumnSwitch’
It seems the problem is, that MODX 3 added a click-handler to the grid (for the column on the right side). This click handler overwrites the click-handler for the checkboxes.
Here is a possible way to fix this.
(There is probably a better way, but my Ext.js knowledge is quite limited.)
Rename this function to onClick (instead of onClickGrid)
Remove this line
Add the line showActionsColumn: false, somewhere around here to hide the column)
If you want to customize the grid (like described above), first copy the file to a custom folder → core/components/<package_name>/migxtemplates/mgr/grids.
Then in the MIGX config → tab “MIGXdb-Settings” → set “Package” to the value of <package_name> you used in the file path above, so that your custom grid gets used.
As I mentioned - I’d got it to work OK on the MIGXdb CMP - then thought I’d submit a quick update of the documentation. It was only when I followed the full thing [creating a MIGX TV] that I realised it wasn’t working that way.