hide show rows

hide show rows

richsmithrichsmith Posts: 2Questions: 0Answers: 0
edited August 2013 in General
Hi There,

Sorry if this is posted in the wrong place. I hope this is just a basic question and im not thinking hard enough.

Anyway I have a table which lists E-Numbers, I would like to have three Buttons at the top: All | Natural | Artificial which when clicked will either show all rows, only the natural ones or only the artificial ones.

Any help in working out the code would be greatly appreciated

Many thanks

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Use the fnFilter API method.

    Allan
  • aaronwaaronw Posts: 89Questions: 3Answers: 4
    How are you determining natural or artificial? For a start, it'll probably be easiest to use table tools :http://www.datatables.net/extras/tabletools/ and then have those buttons hooked up to a fnClick which you define in that button which either sets a filter or clears a filter. http://datatables.net/extras/tabletools/button_options for some more info on that.
  • richsmithrichsmith Posts: 2Questions: 0Answers: 0
    Thank you all for the help here.

    I have given each row and id eg:



    Im not sure if that is the best way to do it.

    I am trying to work out how to use fnFilter to show and hide the rows

    Any suggestions would be appreciated.
This discussion has been closed.