Filter Problem - getting error on _ function

Filter Problem - getting error on _ function

darinlutzdarinlutz Posts: 2Questions: 0Answers: 0
edited September 2013 in DataTables 1.9
I have the following line of code: var results = $('#rfiTable').dataTable()._('tr', { "filter": "applied" });

It is failing at this line of code, telling me: Microsoft JScript runtime error: Object doesn't support this property or method

Can somebody please tell me what I'm doing wrong or what I need to do to get this line of code to work?

Thank you very much.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    edited September 2013
    Are you using DataTables 1.9+?

    It would be helpful if you were to link to a test case or a debug trace: http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read

    Allan
  • darinlutzdarinlutz Posts: 2Questions: 0Answers: 0
    Ok thanks Allan, I'm new here, I appreciate the advice.
  • JerrodJerrod Posts: 2Questions: 0Answers: 0
    edited September 2013
    Hi Allan,

    We really like the datatables but are having a few issues. Probably because of our lack of JS/JQ knowledge.

    We downloaded version 1.9.4, but when I check the header comments, I see 1.7.5 in dt.min.js and 1.0.0 in dt.editable.js. This is an mvc 4 app. I placed the min and editable js files in the scripts folder.
    Everything works fine with that default install.

    I.e.
    [code]



    ...

    $('#table').dataTable(
    { ... });

    [/code]

    We decided we wanted to be able to export our rows that have been filtered, so I created a function, that when clicked would give me the results.

    [code]

    function SearchFunction() {

    var results = $("#table").dataTable()._('tr', { "filter": "applied" }); //line 18

    }

    Export

    [/code]

    This fails with:
    [quote]
    Unhandled exception at line 18, column 16 in JScript - script block

    0x800a01b6 - Microsoft JScript runtime error: Object doesn't support this property or method
    [/quote]

    After a review, of the documentation, I noticed that there are some additional js files under DataTables-1.9.4\media\src, with of course the API. No matter how I put these files into my scripts folder, I get this error. I have tried using the same directory structure as downloaded, all files in the scripts folder, nothing lets me access the API. I think our problem is not having installed it properly.

    What are your thoughts?

    Thanks!
    Jerrod
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    > DataTables-1.9.4\media\src

    Don't include those files. jquery.dataTables.js is built from those files. You need only jquery.dataTables.js (and the CSS file if you want my styles for the table).

    Please link me to your page so I can take a look and see what is going wrong.

    Allan
  • JerrodJerrod Posts: 2Questions: 0Answers: 0
    Allan,

    Thanks for the quick response. I put the jquery.dataTables.js file into scripts and it resolved the issue. I don't know why, or where I got the other two.

    Thanks!
    Jerrod
This discussion has been closed.