I'm trying to create wrapper for datatables.net table component, which create and enable features datatables based on classes defined in table.
$('table.data-table').each(function() {
var props = {};
if ($(this).hasClass('select') && $(this).hasClass('multi'))
props.select = 'multi';
else if ($(this).hasClass('select')
props.select = 'single';
if ($(this).hasClass('long-table')
props.scrollX = true;
...
...
...
$(this).DataTable(props);
});
Run Code Online (Sandbox Code Playgroud)
Like you see above based on classes defined in table DataTable's features enabled for all HTML tables.
Test Case 1: Table should fill it's container.
Test case 2: Scrolling should …