如果我评论IF语句,那么数据弹出工作正常。但是使用IF语句弹出窗口不起作用。我做了很多研究并重写了表格。
我认为代码很好,但为什么数据弹出窗口没有显示我是否添加以下内容?:
661467.0934630792,6577445.839458974
661467.0934630792,-4757336.459308266
eventCenterMapLongitude = 5.942060, eventCenterMapLatitude = 50.751453
5.942060000000001,-39.24854609999999
HTML:
if ($row['description'] == "Incorrect password o") {
$log .= "<td>";
$log .= "
<a class='btn btn-danger' data-popup-open='popup-" . $index . "' href='#' >Password reset</a>
<div class='popup' id='detail-" . $index . "' data-popup='popup-" . $index . "'>
<div class='popup-inner'>
<div class='row'>
<div class='well' >
<h3>Verzend nieuwe wachtwoord</h3>
<form role='form' action='login/requestnewpass/' method='POST' id='contactForm' data-toggle='validator' class='shake'>
<div class='row'>
<div class='form-group col-sm-6'>
<label for='requestnewpass' class='h4'>Username</label>
<input type='text' name='requestnewpass' value='" . $row['username'] . "' class='form-control' id='requestnewpass' placeholder='Enter name' required data-error='Vul hier je naam in'>
<div class='help-block with-errors'></div>
<input type='submit' name='submit' value='submit' class='btn btn-success'>
</div>
</div>
</form>
</div>
<p>
<a data-popup-close='popup-" . $index . "' href='#'>Close</a>
</p>
<a class='popup-close' data-popup-close='popup-" . $index . "' href='#'>x</a>
</div>
</div>
</div>";
$log .= "</td>";
} else {
$log .= "<td>";
$log .= "</td>";
}
<script>
$(function () {
//----- OPEN
$('[data-popup-open]').on('click', function (e) {
var targeted_popup_class = jQuery(this).attr('data-popup-open');
$('[data-popup="' + targeted_popup_class + '"]').fadeIn(350);
this.parent.firstchild()
e.preventDefault();
});
//----- CLOSE
$('[data-popup-close]').on('click', function (e) {
var targeted_popup_class = jQuery(this).attr('data-popup-close');
$('[data-popup="' + targeted_popup_class + '"]').fadeOut(350);
e.preventDefault();
});
});
</script>
通过一些额外的调试,我发现只有在使用bootstrap-table的add on函数后才会出现问题。按钮单击第一页工作,但一旦我使用分页或排序功能,数据点击监听器将被覆盖。