BootstrapDialog 各个属性的说明

 

引用网址:http://nakupanda.github.io/bootstrap3-dialog/

 

Option Possible values Description
type BootstrapDialog.TYPE_DEFAULT or 'type-default' 
BootstrapDialog.TYPE_INFO or 'type-info' 
BootstrapDialog.TYPE_PRIMARY or 'type-primary' (default) 
BootstrapDialog.TYPE_SUCCESS or 'type-success' 
BootstrapDialog.TYPE_WARNING or 'type-warning' 
BootstrapDialog.TYPE_DANGER or 'type-danger'
Give your dialog a specific look, color scheme can be seen on Bootstrap's Button.
size BootstrapDialog.SIZE_NORMAL or 'size-normal' (default) 
BootstrapDialog.SIZE_WIDE or 'size-wide' 
BootstrapDialog.SIZE_LARGE or 'size-large' 
-
cssClass - Additional css classes that will be added to your dialog.
title String or Object(html) -
message String or Object(html) -
buttons array Examples:
BootstrapDialog.show({
    title:'Say-hello dialog',
    message:'Hello world!',
    buttons:[{
        id:'btn-ok',   
        icon:'glyphicon glyphicon-check',       
        label:'OK',
        cssClass:'btn-primary', 
        autospin:false,
        action:function(dialogRef){    
            dialogRef.close();}}]});
Run the code
 
id: optional, if id is set, you can use dialogInstance.getButton(id) to get the button later. 
icon: optional, if set, the specified icon will be added to the button. 
cssClass: optional, additional css class to be added to the button. 
autospin: optinal, if it's true, after clicked the button a spinning icon appears. 
action: optional, if provided, the callback will be invoked after the button is clicked, and the dialog instance will be passed to the callback function.
closable true | false When set to true, you can close the dialog by: 
  • Clicking the close icon in dialog header.
  • Clicking outside the dialog.
  • ESC key.
spinicon Icon class name, for example 'glyphicon glyphicon-check'. 
Default value is 'glyphicon glyphicon-asterisk'.
Specify what icon to be used as the spinning icon when button's 'autospin' is set to true.
data Key-value object. For example {'id' : '100'} Data to be bound to the dialog.
onshow function If provided, it will be invoked when the dialog is popping up. 
onshown function If provided, it will be invoked when the dialog is popped up. 
onhide function If provided, it will be invoked when the dialog is popping down. 
onhidden function If provided, it will be invoked when the dialog is popped down. 
autodestroy true (default) | false When it's true, all modal stuff will be removed from the DOM tree after the dialog is popped down, set it to false if you need your dialog (same instance) pups up and down again and again.
description String If provided, 'aria-describedby' attribute will be added to the dialog with the description string as its value. This can improve accessibility, as the description can be read by screen readers.

 

 

 

你可能感兴趣的:(Web)