1
嗨,我使用的是數據,並使用異步XHR調用對錶進行了laoding。我願意做this,但由於我使用xhr調用表,我的fnCreateSelect函數說由於沒有表數據,所以參數未定義。有沒有辦法在fnInitComplete中調用fnDrawCAllback,反之亦然?在數據表中使用fnInitComplete函數中的fnDrawCallback
任何關於如何做到這一點的建議將不勝感激。
一些代碼:這是我的fnInitcomplete函數我也使用固定列,如果有幫助。
"fnInitComplete": function() {
$("thead th").each(function (i) {
this.innerHTML += "<div class='DataTables_sort_wrapper'><span class='css_right ui-icon ui-icon-carat-2-n-s'></span></div><br/>"+fnCreateSelect(fleetT.fnGetColumnData(i));
$("thead select").each(function (i) {
this.visibleIndex = i;
});
$('select', this).change(function() {
var visIndex = typeof this.visibleIndex == 'undefined' ? 1 : this.visibleIndex;
fleetT.fnFilter($(this).val(), visIndex);
});
});
new FixedColumns(fleetT, {
"iLeftColumns": 2,
"iLeftWidth": 220
});