display result after click

display result after click

marcpiratmarcpirat Posts: 51Questions: 18Answers: 0

Hi

I have many fields who allow to search data...

When user click search, i would like datatable display search result (server side paging).

Because I do server side paging, datatable need a url. How to run search only when user will have clicked on search?

thanks

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @marcpirat ,

    As you can see in this example, the search only happens when the user initiates it. Or, do you want an input box for the search sting, and then the user presses a button to initiate the search? If so, you could just call the API method search() when the button is pressed.

    Cheers,

    Colin

  • marcpiratmarcpirat Posts: 51Questions: 18Answers: 0

    What I search to do is table is empty, user click on a button...to get table result.

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @marcpirat ,

    So, empty table, user does a search, then search results are returned. It sounds like you'll need to delay that first Ajax call to populate the table and combine it with that initial search, something like this.

    Cheers,

    Colin

  • marcpiratmarcpirat Posts: 51Questions: 18Answers: 0

    seem a possibility, thanks

This discussion has been closed.