• Resolved devteamwow

    (@devteamwow)


    We are currently using your plugin, and we need some assistance with specific functionality. Our website has a table that displays data using your plugin, and we would like to implement a feature where the table is automatically populated with data based on values provided in the URL querystring when the page loads.

    The URL format we are using is as follows: https://ogs.on.ca/toni/?firstname=brown&surname=james

    What we aim to achieve is that when a user visits the above URL, the data in the table should be filtered based on the values of “firstname” and “surname” provided in the querystring (in this case, “brown” and “james”).

    Could you kindly guide us on how we can achieve this using your plugin? If there are any specific settings or functions we need to use, please provide us with the necessary details and steps to implement this functionality successfully.

    We appreciate your support and prompt response to help us with this matter. If you require any additional information or clarification, please do not hesitate to ask.

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Kim L

    (@kimmyx)

    Hi @devteamwow,

    Our guide for using URL parameters on your table is here: URL parameters | WP Data Access

    For your case, assuming that firstname and surname are both column names, you can use:

    YOUR-URL/?wpda_search_column_firstname=brown&wpda_search_column_surname=james

    More options available is outlined in the documentation I linked above. ??

    Hope that helps! Let us know if you have more questions.

    Thread Starter devteamwow

    (@devteamwow)

    Hello

    Thank you for your response it really helps us to achieve this, but there are some bugs there if we run?this URL?and then we remove the first name value but still it searches first name?with the James value and if we remove it from the URL but not reloading page, we just remove query string?values from the URL using JS then still it filters data from this values. so is there anything we miss?

    Plugin Contributor Kim L

    (@kimmyx)

    Hi @devteamwow,

    To exclude a column in your URL search, you need to remove the column as well and not just the value. For example:

    YOUR-URL/?wpda_search_column_surname=james

    Hope that helps. Let us know if that works.

    Thread Starter devteamwow

    (@devteamwow)

    No. I don’t?want to exclude?it from the URL if I want to remove any value or I want to perform a clear column search it still loads results from the URL value.https://prnt.sc/eFyg7_WgWRO_?Please refer to this video?https://capture.dropbox.com/UjD8KY2YKSAX7vyg?

    Plugin Contributor Kim L

    (@kimmyx)

    Hi @devteamwow,

    Thanks for the clarification.

    It’s not possible to combine individual column search with URL parameters.

    If you must use URL parameters, it’s best to pair it with a separate search form instead. Please see: Search form | WP Data Access

    Let us know if you have more questions.

    Thread Starter devteamwow

    (@devteamwow)

    Thank you for the quick response. So if we search column value using URL parameter, and if we need to remove that column value or reset values then we must need to remove it from the url and reload the page. there is no any other way to achieve this.

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi @devteamwow

    >>> So if we search column value using URL parameter, and if we need to remove that column value or reset values then we must need to remove it from the url and reload the page. there is no any other way to achieve this.

    Correct!

    Please be aware that you can now also use URL parameters directly in your default where clause. This new feature is explained here:
    https://wpdataaccess.com/docs/data-tables-filters/static-filters/

    This feature has the same implications as using pre-defined URL parameters as it is generally not possible to change a URL without updating the page.

    But there is an alternative… If you are proficiant with javascript you can add search fields to your page and use them to search without using a page load. Here is some documentation to start with:
    https://datatables.net/reference/api/search()

    Does this help?

    Best regards,
    Peter

    I am a WPDA user.

    The solution I have found to clear the search when values are in the query string is to add a button to reload the page without the query string.

    <button onclick="window.location = window.location.pathname;">Clear All Searches</button>

    This clears everything.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How we can search any column value using URL querystring value’ is closed to new replies.