Okay
  Public Ticket #3659579
Filter including null values
Closed

Comments

  •  2
    Alexandru started the conversation

    Hello,


    I have a column of type Integer where I store years. I am using a range slider filter (the slider starts from my min value to my max value) and I found that it does not include rows where the year is null. Is there a possibility to include in my search the rows where the value on this column is null?

    Would really appreciate a solution to this, or a direction to look into,

    Thank you,

    Kind regards,

    Alexandru

  •  1,767
    Miloš replied

    Hi Alexandru,

    Sorry to disappoint you, but at the moment we don't have an 'out of the box' solution for the Number range slider filter to include rows where the value is null/blank.

    I will speak with our QA Team to check if they have any kind of a workaround idea which you might try to achieve this now.

    If we find a workaround, we will make sure to report back and share it with you.


    If you wish to see a built-in solution in the future, you can make a development suggestion, but we can't advise an ETA on it.

    Please feel free to search on our suggestions page

     to see if someone may be already suggested this feature. If you can't see it, feel free to add your suggestion there,  and as more people vote, the feature will move higher on the priority list.

    You can certainly follow our changeLog page if you'd like ( it is also available in the plugin dashboard), where we state any changes/new features/bug fixes during updates;

    and our newsletter, so you're informed about new features, bug fixes, freebies, etc.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  •  1,767
    Miloš replied

    Hi Alexandru,

    I just additionally spoke with our QA Team to try to explain what are the current capabilities 'as close as possible' and why it can not work/current limitations, just to add some details if it helps to clarify it.

    1. For tables which use server-side processing ( Manual Tables and SQL Query tables which have server-side option enabled);

    for these kinds of tables it is not possible in any way, because they pull data from the SQL Database and in the SQL, for any integer value it can not be NULL.

    So that is basically a limitation from the SQL Logic itself, not from our Plugin, in that case.

    For server-side tables, we are not able to say a realistic ETA if that will ever be possible, but you can make a development suggestion for the future.


    2. For non-server-side tables, it can only work to include NULL values if you disable the Slider and just use the standard Number Range filter.


    So, as mentioned before, you can make a future development suggestion, but we can't promise if or when it might become possible.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  •  2
    Alexandru replied

    Dear Milos,

    First of all many thanks for taking your time and investigating further this issue. You and your team have been really supportive on every occasion.

    I am trying to understand point 1. since my table is indeed a manual table. I'm not sure what do you mean by limitation on the SQL side. To me, the query I need on the database after filters are applied would be something like:

    SELECT * FROM `TABLE1` WHERE (year <= 2000 AND year >= 1950) OR year IS NULL

    I will keep trying to find a work-around since this is an important feature in my case. If I find something I'll post back to let you know,


    Thank you,

    Kind regards,

    Alexandru

  •  1,767
    Miloš replied

    Hi Alexandru,

    You're welcome, we are happy to advise.


    Sorry about that point, I did not clarify it the best.

    What I meant to say is, for any table which is an SQL based table and uses server side processing.

    A manual table always uses server side processing.

    In an SQL table we can disable server side option if it has less than 2 thousand rows.

     But still, even on non server side tables, if you try using our number range slider, it is not possible for it to recognize any NULL values.

    Only the standard number range filter in our advance column filters can recognize NULL values without the number range slider and that only works in non server side tables.

    Those are the current limitations.

    Let us know if you have any further questions.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  •  2
    Alexandru replied

    Hello Milos,

    I found a work-around that I would like to share, in case someone else has the same problem in the future:

    1. I changed the data type from Integer to String.

    2. I did an update in the database to replace NULL with ' ' (in my case this was not an issue).

    3. I changed from the filter type: from range slider filter to checkbox.

    4. Possible values for column is set to: Read from table on page load

    5. From here everything is possible with javascript. I have added a range slider using custom javascript that checks and unchecks the plugins checkboxes, thus filtering the table. Then with CSS I did hide the checkboxed that wpDataTables created. Since I have a checkbox for blanks (' ') I always check that one with javascript to make sure to include "null", but in reality it's not null anymore, it's space ' ' :)


    Thank you,

    Kind regards,

    Alexandru

  •  1,767
    Miloš replied

    Hi Alexandru,

    Thank you very much for sharing this custom workaround.

    Any user who comes across this public ticket and needs the same solution, it will be very useful for them.

    I will also make a note of this workaround for the future - it could help the future developments as well.

    Thanks again.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables