0
數據表無響應的,我有幾個數據表具有在打開時顯示的bootbox中的另一個數據表bootbox對話框中的TD領域的聯繫。其關於該特定領域的更多數據。問題是bootbox打開時數據表初始化好了,但是,表沒有響應,在分頁點擊幾下後,bootbox窗口關閉。所有其他數據表按預期工作,只是bootbox中的數據表。jQuery的內部bootbox
所有數據表的頁面加載
var ready = function() {
$('.data-table').dataTable({
"aaSorting": [[ 0, "desc" ]],
"sPaginationType": "bootstrap"
});
$(document).ready(ready);
$(document).on('page:load', ready);
這裏後得到initilized與內打開bootboxes和數據表的鏈接的示例表。鏈接上的onclick是用數據表打開bootbox的。這些被存儲在部分中以使重複更容易。
%table.table.table-hover.table-striped.table-responsive.data-table{style: 'table-layout: fixed; word-wrap:break-word;'}
%thead
%th.col-md-6.col-sm-6.col-xs-6
%span.line Account
%th.col-md-3.col-sm-3.col-xs-1
%span.line No. Alerts
%th.col-md-3.col-sm-3.col-xs-1
%span.line No. Regions
%tbody
- aws_account_breakdowns.each do |aws_account_breakdown|
%tr
%td.col-md-6.col-sm-6.col-xs-6= aws_account_breakdown.try(:arn_account)
%td.col-md-3.col-sm-3.col-xs-1
- id = aws_account_breakdown.arn_account.clean_string
%a{onclick: "bootbox.dialog({message: $('##{id}').html(), title: 'Alerts', buttons: { main: { label: 'Close', className: 'btn btn-primary' } }});"} #{aws_account_breakdown.try(:total_alerts)}
= render 'alerts', alerts: (aws_account_breakdown.alerts || []), id: id
%td.col-md-3.col-sm-3.col-xs-1
- region_id = id + '_region'
%a{onclick: "bootbox.dialog({message: $('##{region_id}').html(), title: 'Regions', buttons: { main: { label: 'Close', className: 'btn btn-primary' } }});"} #{aws_account_breakdown.try(:total_regions)}
= render 'regions', regions: (aws_account_breakdown.regions || []), id: region_id
繼承人具有bootbox div和下一個數據表的部分之一。這是不響應的表,但是被初始化。
- alerts = alerts || @alerts
- id = id || ''
%div.container
%div.row-fluid
%div.modal.fade
%div.modal-dialog
%div.modal-body{id: id}
%table.table.table-hover.table-striped.table-responsive.data-table
%thead
%th.col-md-1
%span.line Status
%th.col-md-2
%span.line Alert Name
%th.col-md-1
%span.line Alert Region
%tbody
- alerts.each do |alert|
%tr
%td.col-md-1{style: 'vertical-align: top !important;'}= alert.try(:status).try(:humanize)
%td.col-md-2{style: 'vertical-align: top !important;'}= alert.try(:signature).try(:name).try(:humanize)
%td.col-md-1{style: 'vertical-align: top !important;'}= alert.try(:region).try(:code).try(:dasherize)