Search bar

Search bar

iExzeiExze Posts: 6Questions: 0Answers: 0
edited November 2012 in General
Hello!

I am just playing around with datatables and noticed there is a search bar and a "show x amount of rows" feature.

I am trying to move the search bar to a different place on the page that fit's in with the breadcrumb, is this possible? If so how?

I have not changed any default code so there is nothing to really paste, though I am using twitter bootstrap for the design, I am using the latest release.

Cheers in advance

Replies

  • allanallan Posts: 63,204Questions: 1Answers: 10,415 Site admin
    > is this possible? If so how?

    Yes - with CSS and sDom to tell DataTables where in the DOM to put the element. See http://datatables.net/styling/

    Allan
  • iExzeiExze Posts: 6Questions: 0Answers: 0
    Thanks allan, just what i was looking for ;)
  • iExzeiExze Posts: 6Questions: 0Answers: 0
    Slight edit on it, it seems the demo over at http://datatables.net/media/blog/bootstrap/ is using BS 1.4.0, will it be updated to 2.0 any time?
  • allanallan Posts: 63,204Questions: 1Answers: 10,415 Site admin
    http://datatables.net/blog/Twitter_Bootstrap_2 :-)
  • iExzeiExze Posts: 6Questions: 0Answers: 0
    edited November 2012
    Awesome, kind of working so far, it seems that
    [code]
    "sPaginationType": "bootstrap",
    [/code]
    Breaks it all and stops the table from showing for some weird reason, removing it from the document on load, so it now looks like

    [code]
    $(document).ready(function() {
    $('#example').dataTable( {
    "sDom": "<'row'<'span6'l><'span6'f>r>t<'row'<'span6'i><'span6'p>>",
    "oLanguage":
    {
    "sLengthMenu": "_MENU_ records per page"
    }

    });
    });
    [/code]

    Works fine, is there any fix or am I going about it the wrong way?

    Cheers
  • allanallan Posts: 63,204Questions: 1Answers: 10,415 Site admin
    Not sure - a link would be useful. However, I would say, make sure you are using the latest integration files from here: https://github.com/DataTables/Plugins/tree/master/integration/bootstrap

    Allan
  • iExzeiExze Posts: 6Questions: 0Answers: 0
    I'll give it a go, actually it's an internal work project, but i'll give it a go in the morning when I get back to work :)

    Cheers
  • iExzeiExze Posts: 6Questions: 0Answers: 0
    Here is my code, http://pastebin.com/CAb6Tyw9, the table isn't even recognizing the DT now
This discussion has been closed.