How to programatically set a data range filter (Datatables column filter)

How to programatically set a data range filter (Datatables column filter)

mmalmeidammalmeida Posts: 15Questions: 2Answers: 0
edited October 2013 in Plug-ins
The Datatables column filter has a nice way of adding date and number range filters (http://jquery-datatables-column-filter.googlecode.com/svn/trunk/dateRange.html ).

However, I can't seem to find a way to change that programatically (e.g., triggered by the click of a button). Other columns can be filtered with oTable.fnFilter(options).

What would you suggest to achieve this on range columns?

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    The column filter is 3rd party code - you'd probably be best asking on that project's site (which you link to).

    Allan
  • mmalmeidammalmeida Posts: 15Questions: 2Answers: 0
    For future reference, here is how I resolved this:
    [code]
    $("#th_id).find("#[id*='range_from']").val(my_date);
    oTable.fnDraw();
    [/code]

    In other words: set the value of the input and redraw the table.
  • sfgolfersfgolfer Posts: 8Questions: 0Answers: 0
    @mmalmeida - could you post your full code including the html? I'm having difficulty implementing this. Thank you.
This discussion has been closed.