Hi,
You may try the following code,
$(document).ready(function () {
$(“#toolbar”).jqxToolBar({
width: 200,
height: 60,
tools: ‘toggleButton’,
initTools: function (type, index, tool, menuToolIninitialization) {
if (type == “toggleButton”) {
var icon = $(“<div class=’jqx-editor-toolbar-icon jqx-editor-toolbar-icon-” + theme + ” buttonIcon’></div>”);
}
switch (index) {
case 0:
tool.jqxToggleButton({
width: 80,
toggled: true,
theme: ‘darkblue’
});
tool.text(“Enabled”);
tool.on(“click”, function () {
var toggled = tool.jqxToggleButton(“toggled”);
if (toggled) {
tool.text(“Enabled”);
} else {
tool.text(“Disabled”);
}
});
break;
}
}
});
});
It successfully changes the theme of the button
Note that you have to import the selected theme, in the example the following one is imported:
<link rel=”stylesheet” href=”./node_modules/jqwidgets-framework/jqwidgets/styles/jqx.darkblue.css”>
Best regards,
Svetoslav Borislavov
jQWidgets Team
https://www.jqwidgets.com/