How to add searchpane in specific div?

How to add searchpane in specific div?

fahadkhanfahadkhan Posts: 7Questions: 3Answers: 0

Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:
Hi,
How do I add search pane in a specific div.

This question has an accepted answers - jump to answer

Answers

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

    See if this example helps.

    Kevin

  • fahadkhanfahadkhan Posts: 7Questions: 3Answers: 0
    edited October 2020

    Hi Kevin,
    Thanks for your reply , the link you shared

    $(document).ready(function() {
    let table = $('#example').DataTable();
    new $.fn.dataTable.SearchPanes(table, {});
    table.searchPanes.container().prependTo(table.table().container());
    });

    I am new to this datatable , to be honest I didnt get the example, what I am trying to do is , I have div named search-pane , and I wan search pane to appear in this div tag. i am not sure how to do it.

    Please help.

  • kthorngrenkthorngren Posts: 21,342Questions: 26Answers: 4,954
    Answer ✓

    The searchPanes.container() API returns the container for the searchPanes. Use the jQuery prependTo() method, or whatever method meets your needs, to place the SearchPanes element. Try replacing table.table().container()) with "#search-pane", assuming div named search-pane means you have `id="search-pane".

    Kevin

  • fahadkhanfahadkhan Posts: 7Questions: 3Answers: 0

    Thanks a lot

This discussion has been closed.