1
我認爲這是一個相當常見的問題。所以我用twitter的引導爲用戶界面和安裝datatable rails gem數據表。這基本上就是我所做的。Datatable-Rails fnResizeButtons/aButtons with Twitter Bootstrap
tradeTable = $("table#create_trades").dataTable(
"sDom": "T<'row-fluid'>t<'row-fluid'<'span6'p>>"
"bPaginate": false
"oTableTools":
"aButtons": [ "copy","csv" ]
)
$('a[href="#tab3"]').on('show', (e) ->
oTableTools = TableTools.fnGetInstance('create_trades')
if (oTableTools != null && oTableTools.fnResizeRequired())
oTableTools.fnResizeButtons()
)
首先,aButtons不限制按鈕的數量。其次,fnResizeButtons仍然無法工作,在代碼之後,組件(Copy,csv ..)仍然具有0寬度和高度。我瀏覽了JavaScript代碼,發現fnResizeRequired()確實是真的,而fnResizeButtons()確實被調用。這裏有什麼問題?
謝謝