Search.../

prefix

Sets or gets the dashboard button prefix.

Description

You can get or set a prefix for a dashboard button. For example, you can set a prefix to be a currency, such as '$'.

The following formats are supported:

  • A string literal, such as '$'.
  • Vector images from the Media Manager: wix:vector://v1/<vector_uri>/<filename>.
  • Vector images from the web: http(s)://<vector image url>.
  • Vector XML string: <svg>...</svg>.

To disable the button's prefix, set the prefix property to null.

Type:

string

 | 

null
Read & Write

Was this helpful?

Get the dashboard button prefix

Copy Code
1let prefix = $w('#myInput').prefix; // $
Set the dashboard button prefix to a string literal

Copy Code
1$w('#myInput').prefix = "$";
Set the dashboard button prefix to a vector image in the Media Manager

Copy Code
1$w('#myElement').prefix = 'wix:vector://v1/ce0334_2cec984ab68c490891dda1b53a33fead.svg/my-vector-graphic.svg';
Set the dashboard button prefix to a vector XML string

Copy Code
1$w('#myElement').prefix = '<svg height="10" width="10"><polygon points="0,9 9,9 5,0" style="fill:lime;stroke:purple;stroke-width:1"/></svg>';
Disable the dashboard button prefix

Copy Code
1$w('#myElement').prefix = null; // Disable the button's prefix property