Okay
  Public Ticket #893896
Filter table for null values
Closed

Comments

  •  2
    Richelle Morats started the conversation

    How would I filter a table for null or blank values using the standard filtering (not predefined filter values)? Thanks for your help!

  • [deleted] replied

    Hi Richelle,

    We need some more information like what kind of table do you use, is it server side or not? Do you have both blank values and NULL? Maybe it would be the best if you can send us link with that table so we can take a look.

  •  2
    Richelle Morats replied

    Hi Miljko,

    The table uses a mySQL Query and server-side processing.  I want to be able to filter for blank values.

    As a work-around, I modified the SQL View used to replace blank values with '0' so we can filter for '0' to find the blank values. But, this is not ideal and I would like to have a way to filter for these blank values. Any suggestions are appreciated!

    Your plug-in is great, thank you.

    Richelle

  • [deleted] replied

    Hi Richelle, 

    Which filter type do you plan to use? 

    Our filters are string based so unfortunately they can't search for NULL value without code customization. 

    One of the solutions would be to modify the query using a WP hook/filter: 

    wpdatatables_filter_mysql_query( $query, $table_id )

    And modify the query 'on the fly' in a way that a filter for blank string would additionally perform a ' OR IS NULL(column_name) ' search.