Sorting by disabled or enabled buttons
Sorting by disabled or enabled buttons
lifeislikechocolates
Posts: 2Questions: 1Answers: 0
Hello,
I'm new here, and this might be a trivial kind of question, but I'd appreciate some help. Is there a way to sort by enabled/disabled buttons from bootstrap in one column?
Here is a live tables link: http://live.datatables.net/saxepabo/1/edit?html,css,js,output
I would like to be able to sort by enabled or disabled buttons, so the content doesn't very much matter.
This discussion has been closed.
Answers
Not a trivial question - a good one . Assuming you want the ability to be able to change the state of the buttons and still have the ordering work there are two options:
row().invalidate()
) when the button's state is updated so it can reread the information from the DOM.Allan
Am sorry, very weak in javascript ):
I tried to use the second option with the following code:
But I am not sure where to put in the
row().invalidate()
either.But I don't know if it'll be needed as the button will only be disabled or enabled by taking the word off the class i.e.
btn btn-info btn-lg
vsbtn btn-info btn-lg disabled
.Live Datables link: http://live.datatables.net/saxepabo/3/edit?html,css,output
$(str).hasClass('btn btn-info btn-lg disabled')
isn't going to work. You can't use jQuery on a string - it needs to be a node.You also don't appear to actually use the
file-size
plug-in at all. There is no type detection for it, so you'd need to usecolumns.type
.Allan