Index

  1. Home
  2. Docs
  3. Index
  4. Data Publisher
  5. Advanced search

Advanced search

Individual column search

The premium version of the plugin supports a number of advanced search options. To search individual columns of a publication, this feature needs be enabled.

» Enable individual column search

Example

The plugin adds searchboxes to the footer by default. This can be changed in the table options advanced column of the Data Publisher. Use option wpda_searchbox to add searchboxes to the header, footer or both:

{
	"wpda_searchbox": "header"
}
{
	"wpda_searchbox": "both"
}
NOTE

The column width for responsive tables is not calculated correctly for search boxes added to the header only. Please use footer or both for responsive tables.

The content of column table options advanced must be valid json! Read more…

Search and list box placeholder prefixes

Placeholders prefixed with Search are added to individual column search and list boxes by default. This prefix can be changed (or removed) using option wpda_search_placeholder_prefix.

Examples

Add Italian translation

{
	"wpda_search_placeholder_prefix": "Ricerca"
}

Remove prefix

{
	"wpda_search_placeholder_prefix": ""
}

Remove prefix and add search icon

{
	"wpda_search_placeholder_prefix": "icon"
}

Removing placeholders

It is also possible to completely remove the placeholders with option wpda_search_placeholder.

Examples

{
	"wpda_search_placeholder": "true"
}
{
	"wpda_search_placeholder": "false"
}
{
	"wpda_search_placeholder": "icon"
}

Combining options

You can also combine wpda_search_placeholder_prefix and wpda_search_placeholder.

{
	"wpda_search_placeholder_prefix": "icon",
	"wpda_search_placeholder": "false"
}

Styling searchboxes

All searchboxes and listboxes contain CSS class wpda_search_textbox, which can be used for styling. Additionally, the column name is added as a CSS class as well, for individual searchbox styling.

Was this article helpful to you? Yes No

4 Replies to “Advanced search”

  1. Hi
    is it possible for the data publisher to publish data on search, instead of publishing 10 database entries at the same time.

    thank you

  2. Hi Peter,

    I’m really enjoying your program, it’s excellent! Is there a way to either not show the number of entries or max it out at a certain number like “10”. I was able to set the default but don’t want users to have the option to select 100 rows.

    Thank you very much,
    Burt

  3. Hi Burt,

    You can hide the length changing input control with the dom option. The default dom value is "lfrtip" where l represents the length changing input control. Please enter the following JSON in your advanced table options to remove the control from your publication:
    { "dom": "frtip" }

    More information about the dom option can be found here:
    https://datatables.net/reference/option/dom

    You can also change the list values and default using the advanced table options. Please have a look at options pageLength and lengthMenu:
    https://datatables.net/reference/option/pageLength
    https://datatables.net/reference/option/lengthMenu

    Example: add the following JSON to your advanced table options to show 10, 20 and 30 in the list and set the default to 20.
    { "pageLength": 20, "lengthMenu": [10,20,30] }

    Hope this helps,
    Peter

Leave a Reply

Your email address will not be published. Required fields are marked *

15 − one =