JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.0/css/jquery.dataTables_themeroller.css "></script>
<script src="//cdn.datatables.net/1.10.3/js/jquery.dataTables.min.js"></script>
<link rel="stylesheet" href="//cdn.datatables.net/1.10.3/css/jquery.dataTables.css">
<table id="datatable9782" class="table table-striped table-bordered bootstrap-datatable datatable">
<thead>
<tr>
<th>Becenév</th>
<th>Rögzítve</th>
<th>Megerősítve</th>
<th></th>
</tr>
</thead>
</table>
JavaScript
/**
* Created by gtoma on 2015.02.05..
*/
(function (window, document, undefined) {
var factory = function( $, DataTable ) {
"use strict";
var mcDataExt = function( target, settings, opts ) {
console.log('start', this);
// Sanity check that we are using DataTables 1.10 or newer
if ( ! DataTable.versionCheck || ! DataTable.versionCheck( '1.10.1' ) ) {
throw 'DataTables Responsive requires DataTables 1.10.1 or newer';
}
this.s = {
dt: new DataTable.Api( settings ),
columns: [],
DataTable: $(target).DataTable()
};
// Check if responsive has already been initialised on this table
if ( this.s.dt.settings()[0].mcDataExt ) {
return;
}
// details is an object, but for simplicity the user can give it as a string
if ( opts && typeof opts.details === 'string' ) {
opts.details = { type: opts.details };
}
this.c = $.extend( true, {}, mcDataExt.defaults, DataTable.defaults.mcDataExt, opts );
settings.mcDataExt = this;
this._constructor();
}
mcDataExt.prototype = {
_constructor: function() {
var that = this;
var dt = this.s.dt;
var DataTable = this.s.DataTable;
DataTable.settings()[0]._mcDataExt = this;
console.log('_constructor', dt.table() );
console.log(DataTable.settings()[0].oInit );
var dtOptions = DataTable.settings()[0].oInit;
var dtColumns = dtOptions.aoColumns;
var dtCDcount = DataTable.table().settings()[0].oInit.columnDefs.length;
console.log('trol', dtOptions, dtColumns, dtCDcount);
var type, newDefs;
for(var i in...