From 4835ea4a90b2fb07830419c4cef8f3b19cb28430 Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 22 May 2017 19:02:01 +0100 Subject: [PATCH] Update columnsearch --- features/columnsearch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/features/columnsearch b/features/columnsearch index 5560313..fdc6362 100644 --- a/features/columnsearch +++ b/features/columnsearch @@ -59,7 +59,7 @@ function initSelectSearch() { if (opts.rowId !== null) { $('tr#' + opts.rowId + ' th', dt.table().node()).each(function(i) { - if (opts.cols.indexOf(i) !== -1) { + if (opts.cols.length === 0 || opts.cols.indexOf(i) !== -1) { var column = dt.column(i); appendSelectTo($(this), column); } @@ -67,7 +67,7 @@ } else { dt.columns().every( function (i) { - if (opts.cols.indexOf(i) !== -1) { + if (opts.cols.length === 0 || opts.cols.indexOf(i) !== -1) { var column = this; appendSelectTo($(column.footer()).empty(), column); } @@ -96,7 +96,7 @@ function initTextSearch() { if (opts.rowId !== null) { $('tr#' + opts.rowId + ' th', dt.table().node()).each(function(i) { - if (opts.cols.indexOf(i) !== -1) { + if (opts.cols.length === 0 || opts.cols.indexOf(i) !== -1) { var column = dt.column(i); var header = $(column.header()); var headerText = header.text(); @@ -106,7 +106,7 @@ } else { dt.columns().every( function (i) { - if (opts.cols.indexOf(i) !== -1) { + if (opts.cols.length === 0 || opts.cols.indexOf(i) !== -1) { var column = this; var footer = $(column.footer()); var footerText = footer.text();