Use data-* attributes on a div/container widget - Mendix Forum

Use data-* attributes on a div/container widget


The use of data-* attributes in HTML markup is valid and widespread.

Currently you cannot use these data attributes from within the container widget, but you can define class and style attributes.


It would be helpful for extensibility to be able as developer to define a data attribute and set a value.

Even better would be to make the value dynamically configurable.


Specific example.

If you want to implement Scrollax, a specific javascript plugin to have a Paralax effect in your Mendix app, you need to add your HTML markup like this:


<div data-scrollax-parent="true">
1 answers

I completely agree! We are trying to add attributes to our page and still figuring out a way that works in our case. 

If you are not using certain widgets like html snippet or rich text in your page then you can use the 'HTML Element' widget as a container.