Hi,
I followed this code to add a custom button into designer/editor toolbar but he show me some error when i remove the 3rd parameter, how can i add a button without image?
Thank you in advance.
Adding custom button into designer Toolbar
-
- Posts: 6
- Joined: Mon Jun 13, 2022 7:55 am
-
- Posts: 791
- Joined: Tue Sep 07, 2021 10:11 am
Re: Adding custom button into designer Toolbar
Hello,
Please check the following code:
Thank you.
Please check the following code:
Code: Select all
var toolBarRow = designer.jsObject.options.toolBar.firstChild.tr[0];
var customButton = designer.jsObject.StatusPanelButton("customButton1", "Test", null, null, null, 30, 30);
var buttonCell = document.createElement("td");
buttonCell.className = "stiDesignerToolButtonCell";
buttonCell.appendChild(customButton);
toolBarRow.insertBefore(buttonCell, toolBarRow.childNodes[3]);
customButton.action = function () {
alert("Button clicked!");
}
-
- Posts: 6
- Joined: Mon Jun 13, 2022 7:55 am
Re: Adding custom button into designer Toolbar
Hi, it works, thank you so much.
-
- Posts: 791
- Joined: Tue Sep 07, 2021 10:11 am
Re: Adding custom button into designer Toolbar
Hello,
You are welcome!
You are welcome!