Geeth Welagedara Geeth Welagedara - 7 months ago 39
Javascript Question

How to add Labels to Bootstrap dialog footer

Need to add

bootstrap
label on footer of
bootstrap3-dialog
. according to this tutorial can add only buttons in footer area.

BootstrapDialog.show({
title: 'Default Title',
message: 'Click buttons below.',
buttons: [{label: 'Title 1'}, {label: 'Title 2'}]
});

Answer

I think you can handle that with CSS if you are familiar with, the aim is it will always be a button but with a "label" style, something like this :

  1. Add a css class for each 'label' you want :

BootstrapDialog.show({ title: 'Default Title', message: 'Click buttons below.', buttons: [{ label: 'Title 1', cssClass: 'buttonAsLabel1' }, { label: 'Title 2', cssClass: 'buttonAsLabel2' }] });

  1. Declare the Css classes the same way as the related Bootstrap label

.buttonAsLabel1 {..} .buttonAsLabel2 {..}

should worked ^^

Comments