Can I insert search div into another div?

Can I insert search div into another div?

jnuijnui Posts: 2Questions: 0Answers: 0
edited August 2013 in General
I am using sDom to add the search element above the datatable.
but I want to instead make the search field go into an existing div on the page.
is there any way to do this already?

if there is no existing way to do this, which callback should I use to move the search dom element to another location?
and if possible an example of this.
thanks

current code
[code]
oTable = $('#tblOrders').dataTable({
"sScrollY": '300px',
"bDeferRender": true,
"sDom": '<"filterDiv"f>t'

}); [/code]

thanks

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    > is there any way to do this already?

    Two options:

    1. Use the fnFilter API with your own input element

    2. Move the DataTables created input into your div after the table has been created

    Allan
  • jnuijnui Posts: 2Questions: 0Answers: 0
    thanks Allan, fnFilter works perfectly.
    (I had tried it before but it didn't work, turned out browser cache issue).
This discussion has been closed.