You can control your datalist column's display format using the Javascript Condition Formatter Plugin.
This plugin is for Joget v5 Enterprise users only. Joget v6 & DX already have this feature built-in.
For example, you can now display numerical values in your datalist column the color red all values <= 0 and the color green all values > 0 or display comma in number lists.
Steps:
- Edit the column properties in Datalist Builder.
- Click to the 'Formatter" tab.
- Select option "Javascript Condition Formatter".
- Click next button.
- In "Configure Javascript Condition Formatter" tab, you can enter as follows:
Rule |
Formatting |
parseInt({quantity}) <= 0 |
"<span style=\"color:red\">" + {quantity} + "</span>" |
parseInt({quantity}) > 0 |
"<span style=\"color:green\">" + {quantity} + "</span>" |
1==1 |
Number({quantity}).toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ",") |
Do try the related plugin using Beanshell datalist formatting.
What's New
- 2019-04-16: Fix regex parsing bug in Condition Datalist Formatter Plugin.
Steps To Import This Plugin
- Click "Download" on this plugin screen (It will be a .jar file).
- Go to your Joget localhost or server, in Joget Console navigate to "Admin Bar>Systems Settings>Manage Plugins" and click "Upload Plugins" button.
- In "Upload Plugin", select the plugin .jar file you just downloaded, then click "Upload".
- Depending on the plugin type, you can now view your new plugin in your form or datalist or userview.
- Remember to always uninstall the old plugin before uploading a new version.
- The Joget Knowledge Base has more information on managing and developing plugins.