PluginList sublist | |
New in Tiki27, permitting to improve PluginList, and fixes/enhancements are being backported to the Tiki26 branch. Once it is more stable/robust, it may also be backported to Tiki24. This was one of the recommendations from this large project: FOSDEM 2024 Related Merge request: PluginList SUBLIST MR |
Example Usage | |
PluginList SUBLIST gives the ability to join several trackers and get mixed results into a single array, greatly optimizing the performance when subqueries and sub-list plugins are needed.
Copy to clipboard
First List Plugin joins tracker 1 (tracker Region) and tracker 2 (tracker Hospital) with an Item Link field in tracker 2 (tracker Hospital) pointing to tracker 1 (tracker Region) called tracker_field_hospitalRegion....Sublist filters the results by the ID of the record coming from the parent tracker(here tracker Region). Note: The underlying implementation makes sure to execute only one query for all the records found in the parent list block and then distributes the results to the relevant resultset rows. Output template is using the stock table template with wiki formatting the name field of tracker 1 (tracker Region) and then wiki formatting the table column for region name using nested keys like 'region.name'.
|
Example Using Pivot table | |
You can use SUBLIST in pivottable as you normally would in a plugin list - define the SUBLIST and either format some of the columns there or leave all columns (skip formatting blocks in sublist). In order for the results to appear in the main pivottable array of data, you must include the fields in the display blocks in the main pivottable.
Copy to clipboard
This example shows how to include 2 remote tracker fields (tracker_field_hospitalName, tracker_field_regionName) in the parent result set using the keys 'tracker_field_hospitalName' and 'region.tracker_field_regionName'. These 2 will appear as fields in the PluginPivotTable and you would be able to use them as normal fields. Note that this works for non-multiple use-cases. If you have multiple results, they will appear as an array and there might be problems handling the data in pivottable.
Also note that the The given above code would produce: |
Related | |
See also: |