Horizontal Scrolling with Filters work around?

Horizontal Scrolling with Filters work around?

alexramoalexramo Posts: 2Questions: 0Answers: 0
edited January 2013 in General
Hello Everyone,
I have found many past questions, but not really any solutions or work arounds. Has anyone yet figured out how to utilize both horizontal scrolling and column filtering?

Thank you in advance,
Alex

Replies

  • bbaranibbarani Posts: 32Questions: 0Answers: 0
    edited January 2013
    This is what I have done to implement the individual column filtering with horizontal scrolling...

    I have set the sscrollx to 100% (you can set it to whatever value as you want)...
    "sScrollX": "100%",

    Since I am using tabs and each tabs has a separate datatable, I appended the column filter (input) and assigned it a unique id.

    var columnFilter=(''+
    ''+
    ''+
    ''+
    '');

    $('#filter_'+elementId).append(columnFilter);


    Then I used the fnFilter method to filter the data,

    $('#col1_' + elementId).keyup(function () {
    oTable.fnFilter($('#col1_' + elementId).val(), 0, false, false, false, true);
    });
  • alexramoalexramo Posts: 2Questions: 0Answers: 0
    Thank you bbarani for your help, will give it a try.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Sounds like a fair approach.

    @Alax - are you able to link us to a test case showing it not working? I've just put this example together, based on my column filtering example and it works okay: http://live.datatables.net/ezuhed/edit#javascript,html . The one thing to watch is that since I've only got a single table on the table, I've got fairly 'loose' selectors - you may need to tighten them up for your use case.

    Regards,
    Allan
This discussion has been closed.