Position search box

Position search box

shanisonshanison Posts: 7Questions: 0Answers: 0
edited September 2010 in General
Hi, is it possible to position the search box at a certain position during the initialization? For eg.
I already have a . Is it possible to inject the search box to be within this div? The sDom doesn't seem to work. I only inject div instead of repositioning.

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    It's not possible for DataTables to put the input box into the DOM somewhere out of the control of sDom - but there are two fairly easy options:

    1. Move the filtering input DataTables adds input your div after you initialise DataTables
    2. Stick in an input box yourself, and add an event handler which will call fnFilter on keypress.

    Allan
  • hkssonhksson Posts: 4Questions: 0Answers: 0
    Hello, I also have a same question. Can I use the search function like that?
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Yes - although you need a reference to the DataTable - oTable is the reference I personally typically use - since fnFilter isn't global function (i.e. oTable.fnFilter...). However, it is usually better to assign a jQuery event handler for the keypress, unless you have a good reason to use a DOM0 event.

    Allan
  • arvindarvind Posts: 1Questions: 0Answers: 0
    hi
    i need to insert some buttons adjacent to search box.
    can you help me???
    pls
    e.g



    button1: button 2: search:[ search box ]
This discussion has been closed.