How to add a button after show Entries and how dataTable result will refresh after click on button.

How to add a button after show Entries and how dataTable result will refresh after click on button.

Anup RoyAnup Roy Posts: 3Questions: 1Answers: 0

Hello, I have one requirement and here is the details. I want to add one button(Go) after "Show Entries". Once user select number of entries from drop down and click on Go button, datatable result need to refresh based on number selected. Could you please help me to resolve and let me know if you need any details.
Please note, Unless user click on Go button datatable result should not refresh.

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,142Questions: 26Answers: 4,736

    Sounds like you should create your own length change input. Use the dom option to remove the default length change option or set the lengthChange to false.

    You button click event will use page.len() to set the page length.

    You can use the technique in the Custom toolbar element example to display your custom element with the Datatables elements.

    Kevin

  • Anup RoyAnup Roy Posts: 3Questions: 1Answers: 0

    I am looking something like below.

  • kthorngrenkthorngren Posts: 20,142Questions: 26Answers: 4,736
    Answer ✓

    Understood, Do you have questions about the above recommendations?

    I guess you can turn off the Datatables change event and use the button to get and set the page length. Something like this:
    http://live.datatables.net/sipesuyo/1/edit

    Kevin

  • Anup RoyAnup Roy Posts: 3Questions: 1Answers: 0

    Thanks Kevin, it worked for me.

Sign In or Register to comment.