A callback function where settings can be made to the tools specified in the tools
property. The initTools
callback function is called twice for each
tool. On the first call, the settings are applied to the tool as it appears in the
toolbar. On the second call, the settings are applied to the tool when it is minimized.
This allows the tool to appear differently in both cases if different settings are
applied.
If you wish to disable the minimization of a tool, return { minimizable: false
}
in initTools
. If you wish the tool to be minimizable but
not to appear in the minimize pop-up menu, return { menuTool: false }
.
In these cases, there will only be one call of initTools
for this tool.
initTools
is passed four parameters:
type
- the type of the tool, as specified in tools
.
index
tool
- a jQuery object representing the tool.
menuToolIninitialization
- a boolean value, specifying whether initTools
is called for the toolbar tool (false
) or the pop-up
menu tool (true
).
Code example
Set the initTools
property.
$("#jqxToolBar").jqxToolBar({ width: "100%", height: 35, tools: 'button | dropdownlist combobox | input',
initTools: function (type, index, tool, menuToolIninitialization) {
switch (index) {
case 0:
tool.text("Button");
break;
case 1:
tool.jqxDropDownList({ width: 130, source: ["Affogato", "Breve", "Café Crema"], selectedIndex: 1 });
break;
case 2:
tool.jqxComboBox({ width: 50, source: [8, 9, 10, 11, 12, 14, 16, 18, 20], selectedIndex: 3 });
break;
case 3:
tool.jqxInput({ width: 200, placeHolder: "Type here..." });
break;
}
}
});
Get the initTools
property.
var displayFormat = $('#jqxToolBar').jqxToolBar('initTools');