in Individual column searching (select inputs)

in Individual column searching (select inputs)

mgutbormgutbor Posts: 32Questions: 5Answers: 0

it would be possible to have <select multiple> in this view???

https://datatables.net/examples/api/multi_filter_select.html

Thanks in advance.

Replies

  • scholarlylabsscholarlylabs Posts: 16Questions: 0Answers: 2

    Yes, easy to add multiselect.

    When we have complex column filtering needs, we use the YADCF plugin. The YADCF examples show you a full range of column filtering options: http://yadcf-showcase.appspot.com

    Good luck!

  • mgutbormgutbor Posts: 32Questions: 5Answers: 0

    Thanks for your help...but could you show me some code integrated with DataTables?

    Thanks again.

  • mgutbormgutbor Posts: 32Questions: 5Answers: 0

    Hi again,

    thanks for the answer, scholarlylabs.

    Now I have used YADCF plugin, I have another question:

    Isn't possible to filter more than 4 columns with this plugin?

    My code is;

    ==================================================================
    'use strict';

            var oTable = $('#example').dataTable({
                colReorder: true,
                language : {
                    "url": "http://cdn.datatables.net/plug-ins/1.10.12/i18n/Spanish.json"
                },
            }).yadcf([
                {
                column_number: 0,
                    filter_type: "multi_select",
                    select_type: 'select2',
                }, {
                    column_number: 2,
                    filter_type: "multi_select",
                    select_type: 'select2',
                    column_data_type: "html",
                    html_data_type: "text",
                }, {
                    column_number: 4,
                    filter_type: "multi_select",
                    select_type: 'select2',
                    column_data_type: "html",
                    html_data_type: "text",
                }, {
                    column_number: 10,
                    filter_type: "range_date",
                    date_format: "dd/mm/yyyy",
                    filter_delay: 500
    

    }]);

    But I only have 4 filter (as shown at the picture image001.jpg), and I have to filter column 10 (Init date).

    How could I solved it?

    Thanks in advance again.

  • daniel_rdaniel_r Posts: 460Questions: 4Answers: 67

    make sure you included jqery ui js/css because yadcf (by default) make use of the jquery ui date picker, if you did included and it still does not work , post a test page that shows the problem

  • mgutbormgutbor Posts: 32Questions: 5Answers: 0
    edited November 2016

    Hi daniel and excuses for my delay.

    Here is the example:

    https://jsfiddle.net/mgutbor/0566dbvv/

    I dont know how only the five first columns ar "filterable".

    Thanks again for your quick support.

  • daniel_rdaniel_r Posts: 460Questions: 4Answers: 67

    I'll tell you why :smile:

    Your table structure is invalid, make sure that inside your thead -> tr you will have only th elements and not a mixture of th / tr

    see working jsfiddle

  • mgutbormgutbor Posts: 32Questions: 5Answers: 0
    edited November 2016

    Daniel, really thanks again for your quick support. So many test I have done that It's a headhache.

    As a final question, will be possible to integrate this modules: yadcf, colreoder and scroll???

    Beacuse when I use scroll in this proyect filters dissapears.

    Chrome console error: Uncaught TypeError: Cannot read property 'appendChild' of undefined(…)

    Thanks a lot again.

  • daniel_rdaniel_r Posts: 460Questions: 4Answers: 67

    should be possible, again - a jsfiddle is required...

  • mgutbormgutbor Posts: 32Questions: 5Answers: 0

    Here is the jsfiddle:

    https://jsfiddle.net/mgutbor/0566dbvv/3/

    As you can see, "yadcf" and "colreorder" works perfectly in the previous example, but when I add "scroller" "yadcf" filters disappears.

    Thanks a lot again.

  • daniel_rdaniel_r Posts: 460Questions: 4Answers: 67
    edited November 2016

    Please use the latest beta of yadcf (it contains relevant fix for your setup) , second of all, please provide a jsfiddle in which the headers move along with the scrolling of the columns

  • mgutbormgutbor Posts: 32Questions: 5Answers: 0

    Daniel, thanks again. After I add the latest beta of yadcf everything is solved.

    Really, really, really thanks for your GREAT HELP.

This discussion has been closed.