Custom filtering - range seach does not work

Custom filtering - range seach does not work

nandoonandoo Posts: 3Questions: 1Answers: 0
edited August 2014 in Free community support

Hi! This is my first post here, and I want to say that this is a great plugin and it sure helps me understand jQuery more.

So I have a table, I get the data with server-side processing. I tried to make a range search. The problem is that it isn't working. The code what is in $.fn.dataTable.ext.search.push( ) isn't executed. I put an alert( ) in it to check it, and I got nothing. (I tried alert( ) -ing in the example file, and it automatically called the alert as it should).

I have my javascript in the header, and $.fn.dataTable.ext.search.push( ) is not in the $('document').ready() event handler. The whole js script looks like this

    $.fn.dataTable.ext.search.push(
        function( settings, data, dataIndex ) {
            alert ('test');
        }
    );

    $('document').ready(function()
    {
        var table = $('#table').DataTable( {
            'processing': true,
            'serverSide': true,
            'ajax': 'modules/getTable.php'
        });
    });

The getTable.php calls the ssp.class.php, they are the official example files.

What should I do? Is it even working with server-side processing tables?

Edit: I get no errors in the console.

This question has an accepted answers - jump to answer

Answers

  • daniel_rdaniel_r Posts: 460Questions: 4Answers: 67

    You can try my yadcf (it has server side support and 3 different range filters)
    http://yadcf-showcase.appspot.com/server_side_source.html (ignore the fact that the showcase shows the table already pre-filtered)

  • nandoonandoo Posts: 3Questions: 1Answers: 0

    Thanks, it looks great, but sadly this isn't exactly what I am looking for. I need a filtering interface which is outside of the table.
    Well, and of course I want to know what caused my problem, and how to solve it.

  • daniel_rdaniel_r Posts: 460Questions: 4Answers: 67
    Answer ✓

    cool...

    just know that yadcf have the filter_container_id: property that you can set with your external wrapper for the filter like here http://yadcf-showcase.appspot.com/DOM_source.html

    :)

  • nandoonandoo Posts: 3Questions: 1Answers: 0

    Nice! I'm going to use your extension afterall. Thank you.

  • daniel_rdaniel_r Posts: 460Questions: 4Answers: 67

    You are welcome. I recommend you to go over the showcase / docs and see yadcf features (there are many...)

  • chrneuchrneu Posts: 3Questions: 1Answers: 0

    Hi Daniel,

    I tried to use your number range filter. But I don't know how to implement this server side with PHP. Do you have an example for this scenario?

    Thanks for your lib! I really appreciate it. :)

This discussion has been closed.