ButtonSelect width
</> Source
<!DOCTYPE html>
<html>
<head>
<title>ButtonSelect width</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<link rel="stylesheet" type="text/css" href="../../../codebase/fonts/font_roboto/roboto.css"/>
<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/>
<script src="../../../codebase/dhtmlx.js"></script>
<script>
var myToolbar;
var sel;
function doOnLoad() {
sel = document.getElementById("sel");
myToolbar = new dhtmlXToolbarObject({
parent: "toolbarObj",
icons_path: "../common/imgs/",
xml: "../common/dhxtoolbar_buttonselect.xml",
onload: updateList
});
}
function getId() {
var id = sel.options[sel.selectedIndex].value;
return id;
}
function setWidth() {
var id = getId();
var wdth = Number(document.getElementById("wdth").value);
myToolbar.setWidth(id, wdth);
}
function updateList() {
sel.options.length = 0;
myToolbar.forEachItem(function(itemId){
if (myToolbar.getType(itemId) == "buttonSelect") {
sel.options.add(new Option(itemId, itemId));
}
});
}
</script>
</head>
<body onload="doOnLoad()">
<div id="toolbarObj"></div>
<div style="margin-top: 200px;">
<select id="sel"></select>
<input id="wdth" type="text" style="width: 40px;" value="80">
<input type="button" value="Set Width" onclick="setWidth();">
</div>
</body>
</html>
Documentation
Check documentation to learn how to use the components and easily implement them in your applications.