• Resolved mwkhan786

    (@mwkhan786)


    Hi dear Plugin author, your plugin is great. I really don’t want to bother you by asking yet another question, as you have answered 150+ questions of different TablePress users, and I also read all the questions posted yet (on 49 pages), but, I didn’t find any solution that I want. The functionality I wanted to achieve in TablePress is beyond my understanding so I want to consult you.

    My question is, how do I trigger the Search by ONLY pressing ENTER key instead of triggering search immediately after every key press?

    I hope you would have understood the question.

    Regards,
    Muhammad Waheed Khan

    • This topic was modified 5 years, 8 months ago by mwkhan786. Reason: Edit on question's title to make it more understandable for author
    • This topic was modified 5 years, 8 months ago by mwkhan786.
Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    For this, you can download and install this TablePress Extension: https://tablepress.org/downloads/extensions/tablepress-datatables-search-enter.zip

    After activating that as a new plugin on your site, you can use this extended Shortcode for your tables:

    [table id=123 datatables_search_enter=true /]
    

    to turn this on.

    Regards,
    Tobias

    Thread Starter mwkhan786

    (@mwkhan786)

    Hi TobiasBg, thanks for the quick response.
    I installed the extension that you sent in the link and also inserted the shortcode you sent, but the desired functionality is not achieved.

    Still, when I press even a single character it starts searching that I don’t want.

    Note: I have already done below things (if you think they may be preventing the solution you provided)
    1. I have a custom command (for limiting the search to only first column) applied
    2. I removed the Next and Previous buttons manually by removing the specific code in jquery.datatables.min

    Please Help.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    Can you please post a link to the page with the table where this problem happens, so that I can take a direct look? Thanks!

    Note that removing code in the jquery.datatables.min.js is very dangerous. And it will break after a TablePress update! I do not recommend doing that! Instead, you should just turn off pagination or hide the buttons with CSS code.

    Regards,
    Tobias

    Thread Starter mwkhan786

    (@mwkhan786)

    Wonderful TobiasBg, I have removed the modified jquery.datatables.min and uploaded the unchanged jquery.datatables.min to my server. Now my problem of searching when Enter is pressed is solved. But I want to achieve the following too:

    1. I want to completely remove the < Previous and Next >.
    2. When I enter a single character of search query it finds the first matching record, but actually, I want the matching record must show only when the complete search query matches the keyword in the desired search column.

    Below is the link to the where I have placed the Tablepress, please use the search word 12334SPSS018 to search the record. Now even when I type the first two characters like 12, it searches the matching record, but I want that until the complete search query (12334SPSS018) do not match, there should be no record be shown.

    https://cbsr.com.pk/certificate-verification/

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    1. Just turn off the “Pagination” checkbox on the table’s “Edit” screen.

    2. Unfortunately, I don’t know a solution to this, sorry ??
    The external DataTables JS library does not directly allow this, from what I know.

    Regards,
    Tobias

    Thread Starter mwkhan786

    (@mwkhan786)

    Hi,
    Turning off the “Pagination” shows the all records at once, but I want to show the only single record that a user may search through its certificate ID (Along with hiding the Previous and Next text and their respective arrows < >.

    No problem, I will try to find the solution and will share if I find any.

    Thanks for your kind support.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    ok, you could then hide the pagination using this CSS code

    #tablepress-1_paginate {
      display: none;
    }

    Regards,
    Tobias

    Thread Starter mwkhan786

    (@mwkhan786)

    Weldone TobiasBg, above CSS worked. But, the table colors are now converted to white.

    Anyways, thanks for your kind response, may you be protected from every evil and grief.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! ?? Good to hear that this helped!

    Regarding the colors: Please try clearing the CSS minification cache of your WP Fastest Cache plugin.

    Best wishes,
    Tobias

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘How to trigger search when pressed Enter key only?’ is closed to new replies.