I have a jquery datatable line:
table = $('#reports').DataTable() row = table.row(rowIndex)
How do I get the html class? (it is striped, and I want to find out if itβs not strange or even.
I tried:
row.hasClass('odd') row.className row.attr('class')
any ideas?
Use node with className :
node
className
row.node().className;
Really good question. The usual jQuery way using row.index() :
row.index()
var rowClass = $("#example tbody tr:eq("+row.index()+")").attr('class');
proof of concept β http://jsfiddle.net/7jy46wz4/
Taking what @ rick-hitchcock said, another approach is to use the following code in validation:
var hasOddClass = $(row.node).hasClass("odd");
which, according to the examples you have given, should be closer to what you want.
Source: https://habr.com/ru/post/983446/More articles:Android - detect if wifi is WEP, WPA, WPA2, etc. Program - androidMultiple inheritance without multiple inheritance and without code duplication - javaHow to add an application to a test suite in ALM OTA via C #? - c #What is the preferred method for creating, using and deleting temporary tables in sql server? - sql-serverHow to reference a web service from an ASP.NET MVC project? - c #Waiting periods until the Transcavator synchronizes with the page after 50001ms - angularjsOcclusion of real world objects using three.js - augmented-realityHow to check if a group is expanded or grouped in Android ExpandableListView? - androidWhat is a simple implementation of async.waterfall? - javascriptocclusion of a transparent object. - javascriptAll Articles