"use strict";
var KTDatatablesAdvancedRowGrouping = function() {

	var initTable1 = function() {
		console.log("INIT TABLE");
		var table = $('#kt_table_1');

		// begin first table
		table.DataTable({
			retrieve: true,
			responsive: true,
			pageLength: 25,
			order: [[2, 'asc']],
			drawCallback: function(settings) {
				var api = this.api();
				var rows = api.rows({page: 'current'}).nodes();
				var last = null;

				/*api.column(1, {page: 'current'}).data().each(function(group, i) {
					if (last !== group) {
						$(rows).eq(i).before(
							'<tr class="group"><td colspan="10">' + group + '</td></tr>',
						);
						last = group;
					}
				});*/
			},
			columnDefs: [
				{
					// hide columns by index number
					//targets: [1],
					//visible: false,
				}
				
			],
		});
	};

	return {

		//main function to initiate the module
		init: function() {
			initTable1();
		},

	};

}();

jQuery(document).ready(function() {
	KTDatatablesAdvancedRowGrouping.init();
});