fnGetPosition is not a function

fnGetPosition is not a function

xrcr9709xrcr9709 Posts: 4Questions: 0Answers: 0
edited January 2014 in General
Hello,

Here's what my code does:

[code]var dataTable = $([some-DOM-table]);
dataTable.fnGetPosition([some-DOM-tr-jQuery-object]);[/code]

I get error 'fnGetPosition is not a function'.

I have included 'jquery.dataTables.min.js' and 'jquery.dataTables.columnFilter.js'. I'm a still missing a file or what is wrong with my code?

Thank you


PS: I can provide a link to concrete code, this is for a private internal enterprise project.

Replies

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    Have you included jQuery?
  • xrcr9709xrcr9709 Posts: 4Questions: 0Answers: 0
    edited January 2014
    Correction to my code:
    [code]var dataTable = $([some-DOM-table]).dataTable().columnFilter();
    dataTable.fnGetPosition([some-DOM-tr-jQuery-object]);[/code]
    I thought that maybe it makes more sense to store the result of .dataTable() in variable, though I'm not sure this is necessary, and I still get the same problem.

    How I included jQuery/JavaScript:
    [code]


    [/code]
    '0.js' is what some would have named 'main.js' and is where my code is executed.
    By the way all of this works fine except the fnGetPosition() function.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    > $([some-DOM-table]).dataTable().columnFilter();

    columnFilter (which is 3rd party and not supported here btw) doesn't return a DataTables instance. You want:

    [code]
    var dataTable = $([some-DOM-table]).dataTable();
    dataTable.columnFilter();
    dataTable.fnGetPosition([some-DOM-tr-jQuery-object]);
    [/code]

    Allan
  • xrcr9709xrcr9709 Posts: 4Questions: 0Answers: 0
    edited January 2014
    I found the problems:
    - some part of my code created an equivalent of $($(myDataTable).
    - the row object needs to be a DOM object, not a jQuery object.

    @allan: actually it works fine with columnFilter();
This discussion has been closed.