Table of Contents
These v19 docs are archived ๐Ÿ”’. Go to the latest docs home or try if this exact page is available in the latest docs.

Interface CommandCodeParams

Parameters used for the command code on toolbars (new in v14.4).
โคด๏ธ back to All Command Names

Buttons with Custom Code in a Toolbar

you are here (click to zoom) - discover the stack

In some cases you want to add buttons to a toolbar, which run custom JavaScript code.

How to use v10+

Here's a basic example showing a 2sxc-toolbar with a custom code:

@Edit.Toolbar(toolbar: new [] { "toolbar=empty", "custom?call=helloCustom" })

<script>
  function helloCustom(context, event) {
    alert('hello from custom button');
  }
</script>

For old use, check out the Custom Code in V9 section.

Read also / Demos / Tutorials

History

  1. Introduced in 2sxc v08.06
  2. Improved with call for v10+

Package: Api.Js.SxcJs

Properties

call

Name of the function to call - must be available in the context. This is usually as a function window. Example:
If call is sayHello you need a window.sayHello(params, context, event).

Buttons with Custom Code in a Toolbar

you are here (click to zoom) - discover the stack

In some cases you want to add buttons to a toolbar, which run custom JavaScript code.

How to use v10+

Here's a basic example showing a 2sxc-toolbar with a custom code:

@Edit.Toolbar(toolbar: new [] { "toolbar=empty", "custom?call=helloCustom" })

<script>
  function helloCustom(context, event) {
    alert('hello from custom button');
  }
</script>

For old use, check out the Custom Code in V9 section.

Read also / Demos / Tutorials

History

  1. Introduced in 2sxc v08.06
  2. Improved with call for v10+

Declaration
call: string
Property Value
Type Description
string