w2toolbar.items

Array of the item objects.
Array, default = []
The .items property defines all toolbar items (buttons, drop down menus, etc.) You can define them during object creation or at run-time. If you change this property during run-time, do not forget to call the .refresh() method to refresh it on the screen. If you need to add/remove items during run-time, you can use .add(), .insert(), .remove() methods.
An item object has the following structure: There are 12 types of toolbar items
button regular button
check check button (2 states: checked and unchecked). See .checked property.
radio radio button, similar to check button but other buttons in the group will be unchecked. See .checked and .group property
menu drop down menu. The .items property will be treated as menu items. This property either an array of strings or array of objects. If it is array of string, then each element of the array is a menu item. If it is array of object, then each element of the array is an object of the following type: There are several default icons in w2ui.css file you can use or you can create your own css file with icons. Majority of default icons are used in w2grid. Default icons are: icon-folder, icon-page, icon-reload, icon-columns, icon-search, icon-add, icon-delete, icon-save, icon-edit, icon-bullet-black
menu-check drop down menu of check boxes. It is similar to the menu item, but displays a checkbox next to the menu item. You can check what checkboxes are selected if you read .selected property (toolbar item not menu item). In case of menu-check it is an array of ids of the selected items.
menu-radio drop down menu of radio buttons. It is similar to the menu item, but displays a radio button next to the menu item. You can check what radio button is selected if you read .selected property (toolbar item not menu item). In case of menu-radio it is a single value that is the id of the selected item
drop simple drop down, whatever in .html property will be display in the drop down
html html item, this html will be displayed instead of the toolbar item
color color picker drop down, see .color and .transparent properties.
text-color color picker drop down for text, see .color, .transparent properties.
break vertical separator
spacer horizontal spacer, will push all following buttons to the right hand side

User Comments

comments powered by Disqus