2

I'm using jQuery datatable 1.10.16 and jquery.dataTables.yadcf.js 0.9.1. Below are my datatable functionalities,

  1. server side data
  2. SHow/Hide columns - colvis
  3. State Save and State Load in server side
  4. ColReorder
  5. Column filter (yadcf)

Column filter is NOT required for all the columns. It is required for few specific columns. Everything is working fine except, the column filter is not working for some fields after I do a column reordering. For eg:

dhboardtable = $('#table').DataTable({.....});

yadcf.init(dhboardtable, [
                    ...........
                   {
                      column_number: 11,
                      filter_type: "text",
                      filter_delay: 2000
                    },
                    {
                        column_number: 13,
                        filter_type: "text",
                        filter_delay: 2000
                    },
                    {
                      column_number: 14,
                      filter_type: "text",
                      filter_delay: 2000
                    }

Column index 12 does not need the filtering(as per requirement). So, I didn't have the column index 12 in the yadcf initialization. The issue is when I drag and drop (reorder) the column 14 (or any columns index > 12) to position it before column 12 (no filter column), then column 14 filter is not working.

Could someone please help with this issue? Thanks in advance.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
L Geo
  • 21
  • 4

1 Answers1

0

Grab the latest beta version of yadcf

in addition look at the showcase page of server side and set the "columns" property for the table and use stateSave": true.

it should work with the above setup

Daniel
  • 36,833
  • 10
  • 119
  • 200
  • The DataTable already has the "columns" property and stateSave set as true. I tried with both versions 0.9.2 and 0.9.3 beta. The issue is still not resolved. Here is the error that I see in the browser console, "TypeError: yadcf.getOptions(...)[column_number] is undefined". As I mentioned in my previous post, there are a few columns that does not need to have the column filter. So, the issue is when I drag-drop a column with filter option, to the left of a column without filter, the moved column's filter is not working after that drag-drop operation. – L Geo Feb 18 '18 at 22:40
  • @LGeo maje sure you assign name to the data in the columns, if still no good provide a link to your test case – Daniel Feb 19 '18 at 07:37