How to add buttons in the same row of 'show entries' and 'search' bar?

How to add buttons in the same row of 'show entries' and 'search' bar?

dataphpmysqldataphpmysql Posts: 65Questions: 17Answers: 0

Hello,

I will like to add buttons to the same row in the middle between the 'show entries' and the 'search' bar, how can I do this?

Also, I'm loading datatables without data since the data is called when a button is clicked, similar to this: http://live.datatables.net/huyexejo/121/edit. So how can I 'disable' the search button when there's no data and then automatically enable it when there's data? So initially the search bar should be disabled, then if I click the button and no data loads it'll remain disabled unless the data loads in which case it will automatically be enabled. How can I do this?

Thanks.

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,598

    Hi @dataphpmysql ,

    You can use dom to insert that button, or just insert using jQuery methods like this.

    For the second part, you could just use jQuery's hide() method to hide the search in the table's initComplete, then show() it after you've pulled the data in your click event handler.

    Cheers,

    Colin

This discussion has been closed.