JavaScript Snippet

Content Type: Widget
Categories: Utility

Overview

Insert custom JavaScript to your Mendix pages, taking object attributes as input parameters.

Documentation

JavaScriptSnippet

The widget has been rebuild from the ground up as pluggable widget!

Insert custom JavaScript to your Mendix pages, taking object attributes as input parameters.

Features

Insert JavaScript code which is executed when loading the widget.

Optionally add one or more attributes which can be used inside the JavaScript code.

Optionally for the attribute if it appears to be empty: fill an empty value.

Usage

Place the widget anywhere (relevant) on the Mendix page. Insert JavaScript code that you want to run there.

Add attribute(s) that you may need inside the code.

Link used attributes inside the JavaScript code by using the ${VariableName}.

Whenever using the this string inside the widget, it will be replaced by the widget unique classname.

Issues, suggestions and feature requests

link to GitHub issues

Development and contribution

  1. Install NPM package dependencies by using: npm install. If you use NPM v7.x.x, which can be checked by executing npm -v, execute: npm install --legacy-peer-deps.
  2. Run npm start to watch for code changes. On every change:
    • the widget will be bundled;
    • the bundle will be included in a dist folder in the root directory of the project;
    • the bundle will be included in the deployment and widgets folder of the Mendix test project.

Releases

Version: 2.2.1
Framework Version: 9.12.0
Release Notes: Remove ‘Wait for AttributeList’ and automate this option
Version: 2.2.0
Framework Version: 9.12.0
Release Notes: - Update project package - Add 'Wait for AttributeList' boolean - Update widget preview
Version: 2.1.3
Framework Version: 9.12.0
Release Notes: Improved stability Better usage in combination with attributes
Version: 2.1.2
Framework Version: 9.12.0
Release Notes: **Update return element** display: contents to keep the widget from partaking in the flow of content
Version: 2.1.1
Framework Version: 9.12.0
Release Notes: Improve Use this as parameter
Version: 2.1.0
Framework Version: 9.12.0
Release Notes: Add a way to ref widget element (this)
Version: 2.0.0
Framework Version: 9.12.0
Release Notes: :sparkles: **The widget has been rebuild from the ground up as pluggable widget!** :sparkles:
Version: 1.3.1
Framework Version: 8.0.0
Release Notes: use mx.logger instead of logger.