Component parameters
Parameter BUTTONS
allows specifying arbitrary set of buttons, displaying checkbox and you own html.
Buttons are displayed in sequence indicated in the parameter.
List of button types
save
- green button Saveapply
- blue button Applycancel
- link Cancelclose
- transparent button Closebutton
- transparent buttoncheckbox
- checkbox in right cornercustom
- arbitrary html
Short format
Listing of types and in the format key=>value:
<?$APPLICATION->IncludeComponent('bitrix:ui.button.panel', '', [ 'BUTTONS' => [ 'save', 'apply', 'close' => 'path for link', 'cancel' => 'path for link', 'custom' => '<span></span>', ] ]);?>
Full format
Listing of buttons as an array with fields:
<?$APPLICATION->IncludeComponent('bitrix:ui.button.panel', '', [ 'BUTTONS' => [ ['TYPE' => 'save'], ['TYPE' => 'apply'], ['TYPE' => 'cancel', 'LINK' => '/company/list/'], ['TYPE' => 'custom', 'LAYOUT' => '<span>my content</span>'], ] ]);?>
The following fields are available for all buttons, except the type custom
:
<?$APPLICATION->IncludeComponent('bitrix:ui.button.panel', '', [ 'BUTTONS' => [ [ 'TYPE' => 'save', // type - required 'CAPTION' => 'Сохранить', // name - optional 'NAME' => 'save', // `name` input attribute - optional 'ID' => 'my-save-id', // `id` input attribute - optional 'VALUE' => 'Y', // `value` input attribute - optional 'ONCLICK' => '', // `onclick` input attribute - optional ], ] ]);?>
These fields are already preset by default.
Special button fields
Type close
and cancel
Has unique field: LINK
<?$APPLICATION->IncludeComponent('bitrix:ui.button.panel', '', [ 'BUTTONS' => [ [ 'TYPE' => 'close', // type - required/mandatory 'LINK' => '/segment/list/', // link, when page click - is required/mandatory ], ] ]);?>
Type checkbox
Has two unique fields: CHECKED
and HINT
<?$APPLICATION->IncludeComponent('bitrix:ui.button.panel', '', [ 'BUTTONS' => [ [ 'TYPE' => 'checkbox', // type - required 'CAPTION' => 'Apply', // text - optional 'NAME' => 'apply', // `name` input attribute - optional 'ID' => '123', // `id` input attribute - optional 'VALUE' => 'Y', // `value` input attribute - optional 'ONCLICK' => '', // `onclick` input attribute - optional 'CHECKED' => '', // boolean, displays `checked` input attribute - optional 'HINT' => '', // displays hint on the right from the checkbox text - optional ], ] ]);?>
Type custom
Has only two fields: TYPE
and LAYOUT
<?$APPLICATION->IncludeComponent('bitrix:ui.button.panel', '', [ 'BUTTONS' => [ [ 'TYPE' => 'custom', // type - required 'LAYOUT' => '<div></div>', // arbitrary layout - required ], ] ]);?>
© «Bitrix24», 2001-2024