Is multiple value column filtering possible? like in an excel file which shows a list check box

Is multiple value column filtering possible? like in an excel file which shows a list check box

nickolojonnickolojon Posts: 20Questions: 0Answers: 0
edited January 2012 in General
Please help, i need to make the jquery data table have the same column filtering functionality that excel have, that shows a list checkbox and can select/check multiple values then the table will be filtered

Replies

  • allanallan Posts: 63,540Questions: 1Answers: 10,476 Site admin
    Yes it is perfectly possible.

    There is a plug-in for DataTables called ColumnFilterWidgets which shows how it might be done:
    https://github.com/cyberhobo/ColumnFilterWidgets

    Example:
    http://datatables.net/extras/thirdparty/ColumnFilterWidgets/DataTables/extras/ColumnFilterWidgets/

    If that doesn't met your requirements, then you'll need to roll your own, but fnFilter will provide everything needed to do that.

    Allan
  • nickolojonnickolojon Posts: 20Questions: 0Answers: 0
    Hi Allan,

    Thanks for your suggestion, I will show this to our lead programmer if this will fit the requirements of the users.

    Just a follow up question,
    I cant seem to make the basic column filtering work, can you help me with this

    This is the code I used to instantiate the table

    $('#example').dataTable({
    "aaData": arrayForTable,
    "aoColumns": arrayForColumns,
    "sPaginationType": "full_numbers"
    }).columnFilter();

    Am I doing it the wrong way? This way of instantiating it should show a textbox below each column, but it doesnt show any. By the way the arrayForTable is an array built by another function since the column number can change depending on the user settings and it is shown by using the arrayForColumns variable

    Regards
    nickolojon
  • allanallan Posts: 63,540Questions: 1Answers: 10,476 Site admin
    From the documentation for the column filter (which is a third party plug-in for DataTables - http://jquery-datatables-column-filter.googlecode.com/svn/trunk/index.html ) your initialisation looks correct to me. What aspect of it is not working? Are you getting a Javascript error on the console?

    Allan
  • nickolojonnickolojon Posts: 20Questions: 0Answers: 0
    Hi allan,

    Sorry for the multiple posts, yes a javascript error was triggered "Microsoft JScript runtime error: Object doesn't support property or method 'find'" in theses js files
    1. complete.js
    2. jquery-1.4.4.min.js
    and "Microsoft JScript runtime error: Unable to get value of the property ':': object is null or undefined"
    in 3. jquery-ui.js

    Thanks
    nickolojon
This discussion has been closed.