使用数据表columns().seach().draw()
失败,我找不到错误。
columnas = Array.apply(null, {length: 6}).map(Number.call, Number)
datatable.columns(columnas).every(function(){
that = this;
$('input').on('keyup change', function(){
console.log('keyup')
console.log(that.search(this.value));
that.search(this.value).draw();
});
});
似乎搜索将始终返回所有行。
此外,console.log(that.search($(this).val()).rows().count())
返回完整的数据集计数,
任何帮助将不胜感激。谢谢。
答案 0 :(得分:0)
您的代码中有一些拼写错误,请尝试解决该错误,然后再尝试。
1.将var jurisdictions = trackAnalyticsService.GetJurisdictions(new Track.TrackDataFilter(new int[] { companyId }, null, from, to, userFirmRef), maxJurisdictions);
-- returns 9 rows
if (filter?.Jurisdictions.Count() > 0)
jurisdictions.Where(tag => filter.Jurisdictions.Any(x => x == tag.Ref));
-- jurisidctions should now be filtered to just 2 rows as filter.Jurisidction ref 1 and 2 is contained in jurisdictions and none of the other refs.
更改为that = this
。
2.将var that = this
更改为that.search(this.value).draw()
;
最终解决方案应该是这样的:
that.search($(this).val()).draw();
希望这项工作对您有用。