Date range filtering - for individual table

Date range filtering - for individual table

BusterenBusteren Posts: 52Questions: 17Answers: 4

Hi,

I am looking at this example on how to do date range filtering. However, I might have multiple datatables on one page and was looking at how to control these individually. So I got the start and the end date, but I don't want to use the document.getEelementById or need to use id for the table. Is this possible, if so is there any examples around?

Just looking for a vaguely way of doing this.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,213Questions: 1Answers: 10,415 Site admin

    Hi,

    I've just sent you a PM on this topic :).

    Allan

  • allanallan Posts: 63,213Questions: 1Answers: 10,415 Site admin
    Answer ✓

    The problem here is that the search plug-ins will run on every table on the page. So you need a little bit of logic in each one to limit it to just a specific table. Often I do that by initialising the table first and then creating the plug-in with an if condition inside the function which checks for the right table node or id. There is no way around that at the moment.

    Allan

  • BusterenBusteren Posts: 52Questions: 17Answers: 4

    Would be able to do that, but what about the global variables included in the example:

            var min = parseInt( $('#min').val(), 10 );
            var max = parseInt( $('#max').val(), 10 );
    

    Would it be possible to get these through the function somehow? So say I do not have access to the dom elements with #min or #max.

  • BusterenBusteren Posts: 52Questions: 17Answers: 4

    Seems like pushing a function onto the table before drawing (with the dates required) and then drawing. Then if the dates changes, pop the specific function and push a new search function. Not tested yet, but think it should work.

This discussion has been closed.