Target li in responsive datatable
Target li in responsive datatable
WebCodex
Posts: 71Questions: 13Answers: 3
Hi, I am currently targeting columns in the main table view (not responsive) using the following rowCallback
"rowCallback": function (row, data) {
checkInStash(exid, data.flavour_name, data.flavour_company_name).done(function(data){
if(data == true) {
$(row).addClass( 'instash' );
$(row).find('td:eq(5)').html('<button class="btn btn-primary flavour-stash">Remove From Stash</button>');
} else {
$(row).removeClass( 'instash' );
$(row).find('td:eq(5)').html('<button class="btn btn-primary flavour-stash">Add To Stash</button>');
}
});
How can I target the li of the responsive table to do the same thing?
You can see the table here: https://vccalc.vapingcommunity.co.uk/flavours
Thanks in advance
This discussion has been closed.
Answers
@allan Do I need support credits to get help in the forum now? I'm seeing this on the right side of the screen...
No. Allan and Colin probably haven't had a chance to look at your post.
Is this what you are looking for?
https://datatables.net/extensions/responsive/examples/child-rows/custom-renderer.html
Kevin
I wasn't sure, I don't remember seeing that message before. I wasn't expecting a reply straight away, I know they are very busy. Thanks for clarifying.
Is this what you are looking for?
If it is, I have no idea how to implement that in my
"rowCallback": function
I thought it would be as easy as finding the next tr and then finding the li but I've tried and tried and got nowhere.
Thanks for your reply
Don't think the not about support credits is new.
See if this thread helps:
https://datatables.net/forums/discussion/comment/142469/#Comment_142469
Look at the example in the last post. This code is separate from rowCallback.
Kevin
I've removed the responsive aspect from the table until I can come up with a solution, thanks