0

부트 스트랩의 popover에 드롭 다운을 표시하는 방법을 알 수 없습니다. 모두 내가 자습서 단지 텍스트와 버튼을 표시하고 찾을 수 있습니다. 드롭 다운을 표시하고 데이터를 바인딩해야합니다. 버튼과 이벤트를 표시하기 위해 아래의 방법을 사용했습니다.popover 부트 스트랩의 드롭 다운

var popOpts = { 
     placement: 'left', 
     title: '<span id="trashcan" class="glyphicon glyphicon-trash"></span>Confirm Delete', 
     html: 'true', 
     trigger: 'click', 
     content: '<p>This will be deleted.<br>Are you sure you wish to continue?</p><br><button id="delete" class="btn btn-danger popover-submit" type="button">Yes</button><button id="cancel" class="btn btn-default" type="button">No</button>', 
    } 
    $(".btnDelete").popover(popOpts); 

드롭 다운을 표시하고 부트 스트랩의 팝업에 항목을 바인딩하는 방법을 알아야합니다.

답변

1

당신은

$('.popover-markup>.trigger').popover({ 
    html: true, 
    title: function() { 
     return $(this).parent().find('.head').html(); 
    }, 
    content: function() { 
     return $(this).parent().find('.content').html(); 
    } 
}); 

DEMO

+0

예 그냥 스크립트 형태로 내부에 아무 것도 표시하고, 이벤트를

HTML

<div class="popover-markup"> <a href="#" class="trigger">Popover link</a> <div class="head hide">Lorem Ipsum</div> <div class="content hide"> <div class="form-group"> <select><option>Test</option></select> </div> <button type="submit" class="btn btn-default btn-block">Submit</button> </div> <div class="footer hide">test</div> </div> 

을 결합 할 수있는이

같은 시도 이제이 대답에서이 방법으로 알아 냈습니다. http://stackoverflow.com/questions/12128425/contain-form-within-a-bootstrap-popover?rq=1. 답변 주셔서 감사합니다 :). – RGR

관련 문제