Toolbar for the grid.
Object, default = null
Each grid comes with a toolbar. The
.toolbar property should be initiated during
object creation because after the object is created, the w2toolbar is created too. During object creation you can add additional
buttons to the toolbar in the following way:
Please note, that by default toolbar is hidden. You need to set
.show.toolbar property to true in order to make
toolbar visible. There are also several default toolbar buttons that can be hidden or shown during object creation. They are all part of the
.show property of the grid. Below is the
.show property of the grid with items
relevant to the toolbar with its default values:
There are other items in the
.show property besides those relevant to toolbar.
Auto enable/disable toolbar buttons
Toolbar items might have optional
.batch property. If it is a positive integer, then the button will only
be enabled if same number of records is selected in the grid. If it is true (used to be if it is 0), it will only be enabled if at least one record
is selected. It also can be a function, so that if selection changes, you can determine if button should be enabled or disabled.
Toolbar object
Once the grid object has been created, the
.toolbar property becomes w2toolbar object. The name of this
object is the name of the grid + '_toolbar'. If you have the grid created, you can access w2toolbar object in the following way:
or