The "Search:" box on the grid is auto populating with the text of the logged in user. How can I stop

The "Search:" box on the grid is auto populating with the text of the logged in user. How can I stop

wilkinswilkins Posts: 3Questions: 1Answers: 0

The "Search:" box on the grid is auto populating with the text of the logged in user. How can I stop this from happening?

Answers

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954

    Unless you are using stateSave this doesn't happen by default. If using stateSave then use stateSaveParams to remove the search term as shown in the example.

    If this doesn't help then provide more details of your environment and how the search input is being populated. A link to your page or test case replicating the issue is the best way to show this.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • wilkinswilkins Posts: 3Questions: 1Answers: 0

    Thank you for the answer.
    I don't have a test DB online to give you a live site. I recorded my test session.

    https://portal.unionlogic.net/testcase2.mp4

    The username of the logged in user is automaticlly filled in if the user/pass is saved in the browser.

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954
    edited January 2023

    As I said it could be from stateSave. Or it could be the use of the search option. It could be some custom code outside of Datatables populating the search input. Unfortunately its impossible to tell you how this is happening from a video. Can you post the relevant Javascript code? We might be able to see something obvious.

    Kevin

  • wilkinswilkins Posts: 3Questions: 1Answers: 0

    Thanks Kevin
    I'm not a developer.... My developer guys just emailed that they have a fix that I need to test. Where would the https://datatables.net/reference/option/stateSave. option be in the code if it existed?

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954

    Its hard to say specifically as each environment is different. It will be found in the Datatables initialization code similar to the examples in the docs.

    Kevin

Sign In or Register to comment.