SDom custom toolbar, buttons not toggling

SDom custom toolbar, buttons not toggling

leeguthleeguth Posts: 19Questions: 1Answers: 0
edited April 2014 in DataTables 1.9
I have a custom toolbar showing in my dataTable that has a few bootstrap buttons. The buttons show and do what I want them to but they should toggle (so if one is clicked, the others are not) but for some reason mine all stayed showing as clicked. I'm not sure if I have to do something so they don't show as clicked if I click a different one or not. Here is some of my code:

build the toolbar....
tb = "";
tb += "";
tb += "Show All";
tb += "On Track";
tb += "With Issues";
tb += "Critical";
tb += "No Status";
tb += "";

part of the DataTable - most I didn't think was relevant
oTable = $('#example').dataTable( {
"bAutoWidth":false,
"bProcessing": false,
"bDestroy": true,
"aaData": data,
"sDom": '<"toolbar">frtip',
"aoColumns": [

makes the toolbar show using the above built html.....
$("div.toolbar").html(tb);
$(".filter-btn").click(function(){
$("#example").dataTable().fnFilter($(this).data("filterValue"),5);
});

I used what I could find in your documentation to form this. Like I said, it does function but the buttons don't toggle. Any ideas?

Replies

  • leeguthleeguth Posts: 19Questions: 1Answers: 0
    I tried adding a test case but it's not letting me set it up right. http://live.datatables.net/gicetux/1/edit
    In the 'Javascript' section i put the information from my drill.txt file.

    If you can run this you should see that the 'filter' toolbar does filter the data, but the buttons aren't reacting like radio buttons in that they stay showing as selected after you click another one. Any ideas how to get it to show only the currently clicked button to show as selected?
  • leeguthleeguth Posts: 19Questions: 1Answers: 0
    ended up being an issue with bootstrap css/js versioning....ty anyway.
This discussion has been closed.