0
私のレールアプリケーションでjquery datatableを使用しています。私は特定の列にデフォルトの順序を追加したい。datatableデフォルトの並べ替えが動作しない
$(document).ready(function(){
$('#sample-table-2').DataTable({
responsive: true,
"pagingType": "simple",
bJqueryUI: true,
bServerSide: true,
"aaSorting": [[ 4, "asc" ]], //
sAjaxSource: $('#sample-table-2').data('source'),
"columnDefs": [
{ "width": "10%", "targets": column_count }
]
})
.on('order.dt', function() { eventFired('Order'); })
.on('page', function() {setTimeout(function(){hideCellsOnMobile();},1000)})
.on('search.dt', function() {setTimeout(function(){hideCellsOnMobile();},1000)});
$("table#sample-table-2").parent().addClass("no-padding")
});
しかし、この既定の順序は適用されません。
目標は、ドキュメントによると、配列を期待{:「10%」、「ターゲット」:「幅」[COLUMN_COUNT]}' –