Support » Plugin: TablePress - Tables in WordPress made easy » How to add more search options for data search in table

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    There are some Extensions on the TablePress website that might be helpful here:
    http://tablepress.org/extensions/datatables-column-filter/
    http://tablepress.org/extensions/datatables-columnfilterwidgets/

    Unfortunately, it’s not as easy as adding some CSS code, though.

    Regards,
    Tobias

    Thread Starter phanindrakb

    (@phanindrakb)

    Hi Thanks for that,

    It helps, but looking for a particular search range field in the table.

    From your demo link http://jquery-datatables-column-filter.googlecode.com/svn/trunk/default.html

    You have a column named as Engine version, can i able to search the data (FROM 0 TO 50) of Engine Version ?

    Can we able to give ‘from’ and ‘to’ search options for search any thing in between of them ?

    If you can able to give me that option it would be a great help to me.

    Thanks.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    the Extension currently does not offer an easy way to add such extra parameters.
    I suggest that you change the Extension’s PHP code accordingly.

    Regards,
    Tobias

    Thread Starter phanindrakb

    (@phanindrakb)

    Hi,

    Thanks for your immediate replies and good support,

    But I don’t know code writing, I am requesting you to give me that code and guide me to add it in an appropriate place.

    Thankyou very much.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    the code is on the page that you linked to. Unfortunately, I don’t have the time to make the necessary changes right now, so you will have to try yourself. Sorry.

    Regards,
    Tobias

    Thread Starter phanindrakb

    (@phanindrakb)

    Thanks for that,

    I can understand your precious time,

    I will search some one and request him to add that, at this moment i don’t know any one who can help me with this 🙁

    Thanks for the great plugin.

    Thread Starter phanindrakb

    (@phanindrakb)

    Hi,

    I tried my self and got a little idea.

    I installed column filter[ $(“#tableId”).dataTable().columnFilter(); ]

    And you asked me to place this code $(“#tableId”).dataTable().columnFilter();

    with this code
    $(“#tableId”).dataTable().columnFilter(
    {
    aoColumns: [
    {
    type: “number”
    },
    {
    type: “text”,
    bRegex: true,
    bSmart: true
    },
    null,
    {
    type: “select”,
    values: [ ‘A’, ‘B’, ‘C’ ]
    },
    {
    type: “number-range”
    },
    {
    type: “date-range”
    }
    ]
    }
    );

    From the link https://code.google.com/p/jquery-datatables-column-filter/wiki/ColumnFilter.

    I tried to look at these codes in plugin code section, but no where find any related code to do the needful.

    Requesting your guidelines for to goahead with the exact process.

    I have a demo link http://demo.outlocation.com/table-8/, i want to my range fields to work on this post.

    Thanks.

    Thread Starter phanindrakb

    (@phanindrakb)

    little correction in the third line
    I installed column filter[

    tablepress-datatables-columnfilter/columnfilter.js(inactive)
    tablepress-datatables-columnfilter/tablepress-datatables-columnfilter.php(active)

    ]

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    you can find the relevant section near the bottom of the .php file. That’s where you’ll need to make modifications.

    Regards,
    Tobias

    Thread Starter phanindrakb

    (@phanindrakb)

    Hi

    Thanks for that,

    I come to some near by,

    I found this

    $columnfilter_parameters = $js_options[‘datatables_columnfilter’];

    $command = “$(‘#{$html_id}’).dataTable({$parameters}).columnFilter({$columnfilter_parameters});”;
    return $command;

    Will you please guide me atleast from here, my table id is [table id=8 /]
    my posts link is http://demo.outlocation.com/table-8/

    Your help is greatly appreciated.

    Thanks.

    Thread Starter phanindrakb

    (@phanindrakb)

    exactly this one
    if ( true !== $js_options[‘datatables_columnfilter’] )
    $columnfilter_parameters = $js_options[‘datatables_columnfilter’];

    $command = “$(‘#{$html_id}’).dataTable({$parameters}).columnFilter({$columnfilter_parameters});”;
    return $command;

    Thread Starter phanindrakb

    (@phanindrakb)

    I Tried with that code in different places, it has given me fatal error 🙁

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    yes, that’s the relevant code. Try rewriting this as

    $command = <<<JS
    $('#{$html_id}').dataTable({$parameters}).columnFilter(HERE);
    JS;
    return $command;

    Now, you can insert the desired parameters in the places that I have marked with HERE.

    Regards,
    Tobias

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘How to add more search options for data search in table’ is closed to new replies.