Home Documentation
Getting started General
Components
Forms
Utilities
Check changelog.
0.5.3

JS Init

Initialize our components with 3 differents methods.

For auto init and per component init methods, we provided a simple .no-axentix-init class to disable the basic initialization with the Axentix class for the specified component.
Using this class, you can use all components in your page, except the one you specified. You can now pass your specific parameters to use it.

Auto init

Detect automatically all Axentix components who need to be initialized, in only one line.
Using this way, you don't have to initialize anything else, but you can't pass options to your JS elements.

Per component type

Detect all elements of the specified component type, and initialize all them using the passed options.

Per element

This method initialize the element individually using the passed options.

Methods

Methods are useful to get the instances of the elements on your page. This way, you can interact with them using their specific methods.

Method Description
.getAllInstances() Get a table containing all instances of the JS elements on the page.
.getInstance(string) Get a specific instance using the id of the element. You will get all his properties.
Example : var instanceOfElem = axentix.getInstance('#example-collapsible');
.syncAll() This method resets all components listeners.
This is useful if you are adding elements dynamically like a sidenav-trigger after loading the page.
.sync(string) This method resets the listeners of the specified component.
Example : axentix.sync('#example-collapsible');
.resetAll() This method resets all components.
This is useful if you are changing a component dynamically, like a sidenav position.
.reset(string) This method reset the specified component.
Example : axentix.reset('#example-collapsible');

Events

Event Description
ax.component.sync Event sent when the sync() method of the component is called.
ax.component.reset Event sent when the reset() method of the component is called.