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
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
- Introduced in 2sxc v08.06
- Improved with
callfor 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
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
- Introduced in 2sxc v08.06
- Improved with
callfor v10+
Declaration
call: string
Property Value
| Type | Description |
|---|---|
| string |