Using DataTables components on the whole page

Using DataTables components on the whole page

alexjalexj Posts: 7Questions: 0Answers: 0
edited January 2010 in General
Hello,

I would like to use a component of DataTables outside the div it is created in, see here for an example:

http://vontis.nl/img/datatables.jpg

I want the search in the sidebar, I think I can get the pagination parts in the bottom with the right style (sDom), but I cant seem to figure out how to get the search box in the sidebar.

Tried copying the div when it was created into the sidebar, and removing the filter functionality with sDom, but when I typed in the box, nothing happened (no event attached I think)

Is this possible?

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Hi alexj,

    sDom only allows you to create DOM elements and control them directly around the table, as you are seeing. However it can be done, and off the top of my head:

    1. Create your text box that you want to use a filter yourself and attach the fnFilter API function to it for a keypress event: http://datatables.net/api#fnFilter
    2. Once the element is created by DataTables, just move it in the DOM (i.e. insert it somewhere else, and the browser will treat that as a move).

    Also worth noting - you can use this tool to "see" events on nodes: http://sprymedia.co.uk/article/Visual+Event

    Regards,
    Allan
This discussion has been closed.