按钮中的Bootbox和Font awesome图标

时间:2015-12-05 15:57:29

标签: twitter-bootstrap font-awesome bootbox

我使用bootbox插件进行引导模式。 我想知道如何在引导框对话框按钮中放置F.A.图标。

这是我的代码:

CREATE TABLE player
( 
  member_name VARCHAR2(70) PRIMARY KEY NOT NULL,
  date_of_birth DATE,
  member_address VARCHAR2(300),
  contact_number INT NOT NULL,
  gender VARCHAR2(1) NOT NULL CHECK(gender IN('f','m')),
  club_seeding INT NOT NULL,
  county_seeding INT NOT NULL,
  renewal_date DATE,
  m_type VARCHAR(9) NOT NULL CHECK(m_type IN('junior','student', 'senior', 'family', 'associate'))
);

CREATE TABLE team
(
  team_id INT PRIMARY KEY NOT NULL,
  club_seeding INT,
  county_seeding INT,
  player1 VARCHAR2(70) NOT NULL,
  player2 VARCHAR2(70) NOT NULL,
  team_name VARCHAR2(145) NOT NULL

,constraint fk_team_player_1 foreign key (PLAYER1)
  references player (member_name)
,constraint fk_team_player_2 foreign key (PLAYER2)
  references player (member_name)  
);

我只需要在引导框按钮中添加一个带有自定义类的bootbox.dialog({ className: "modal-danger nonumpad", closeButton: false, animate: false, title: '...', message: "...", onEscape: null, buttons: { refresh: { label: "Refresh", className: "btn-warning btn-lg pull-left", callback: function(){ return false; } }, main: { label: "Setup", className: "btn-primary btn-lg", callback: function(){ return false; } } } }); 元素:

<i>

1 个答案:

答案 0 :(得分:2)

我想你可以。 按钮的Label选项支持HTML,而不仅仅是文本。所以

bootbox.dialog({
     className: "modal-danger nonumpad",
     closeButton: false,
     animate: false,
     title: '...',
     message: "...",
     onEscape: null,
     buttons: {
          refresh: {
               label: "<i class=\"fa fa-check\"></i> Refresh",
               className: "btn-warning btn-lg pull-left",
               callback: function(){
                    return false;
               }      
          }
      }
});