如何从数据表中的 fnSettings() 获取列类型

How to get the acolumns type from fnSettings() in datatables

我必须将值设置为历史记录中的 aocolumns,所以我必须知道 filter.I 的类型 find how to do for input.Now 我因为 select.Thank 而被阻止提前 我的代码:

$.each(oTable.fnSettings().aoPreSearchCols,function(filterIndex,filterValue){
     //console.log(theadRow.find("th:nth-child(8):selected").val(filterValue.sSearch).removeClass("search_init"));
     (filterValue.sSearch)?theadRow.find('th:nth-child('+(filterIndex+1)+') input').val(filterValue.sSearch).removeClass("search_init"):''; });

这可能有效(未经测试):

$.each(oTable.fnSettings().aoPreSearchCols, function(filterIndex, filterValue){
   if(filterValue.sSearch != ""){
      $('th', theadRow).eq(filterIndex + 1).find('input, select')
         .val(filterValue.sSearch)
         .removeClass("search_init");
   }
});