All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.bower_components.datatables.net-rowgroup.js.dataTables.rowGroup.min.js Maven / Gradle / Ivy

The newest version!
/*! RowGroup 1.0.4
 * ©2017-2018 SpryMedia Ltd - datatables.net/license
 */
(function(a){if(typeof define==="function"&&define.amd){define(["jquery","datatables.net"],function(b){return a(b,window,document)})}else{if(typeof exports==="object"){module.exports=function(b,c){if(!b){b=window}if(!c||!c.fn.dataTable){c=require("datatables.net")(b,c).$}return a(c,b,b.document)}}else{a(jQuery,window,document)}}}(function(e,c,a,f){var d=e.fn.dataTable;var b=function(j,i){if(!d.versionCheck||!d.versionCheck("1.10.8")){throw"RowGroup requires DataTables 1.10.8 or newer"}this.c=e.extend(true,{},d.defaults.rowGroup,b.defaults,i);this.s={dt:new d.Api(j),dataFn:d.ext.oApi._fnGetObjectDataFn(this.c.dataSrc)};this.dom={};var g=this.s.dt.settings()[0];var h=g.rowGroup;if(h){return h}g.rowGroup=this;this._constructor()};e.extend(b.prototype,{dataSrc:function(h){if(h===f){return this.c.dataSrc}var g=this.s.dt;this.c.dataSrc=h;this.s.dataFn=d.ext.oApi._fnGetObjectDataFn(this.c.dataSrc);e(g.table().node()).triggerHandler("rowgroup-datasrc.dt",[g,h]);return this},disable:function(){this.c.enable=false;return this},enable:function(g){if(g===false){return this.disable()}this.c.enable=true;return this},_constructor:function(){var i=this;var h=this.s.dt;var j=h.rows();var g=[];j.every(function(){var l=this.data();var k=i.s.dataFn(l);if(g.indexOf(k)==-1){g.push(k)}});h.on("draw.dtrg",function(){if(i.c.enable){i._draw()}});h.on("column-visibility.dt.dtrg responsive-resize.dt.dtrg",function(){i._adjustColspan()});h.on("destroy",function(){h.off(".dtrg")})},_adjustColspan:function(){e("tr."+this.c.className,this.s.dt.table().body()).attr("colspan",this._colspan())},_colspan:function(){return this.s.dt.columns().visible().reduce(function(h,g){return h+g},0)},_draw:function(){var l=this;var g=this.s.dt;var s=g.rows({page:"current"});var h=[];var o,m;s.every(function(){var t=this.data();var i=l.s.dataFn(t);if(i===null||i===f){i=l.c.emptyDataGroup}if(o===f||i!==o){h.push([]);o=i}h[h.length-1].push(this.index())});for(var k=0,p=h.length;k").append(e("").attr("colspan",this._colspan()).append(h))}}return i.addClass(this.c.className).addClass(g)}});b.defaults={className:"group",dataSrc:0,emptyDataGroup:"No group",enable:true,endClassName:"group-end",endRender:null,startClassName:"group-start",startRender:function(g,h){return h}};b.version="1.0.4";e.fn.dataTable.RowGroup=b;e.fn.DataTable.RowGroup=b;d.Api.register("rowGroup()",function(){return this});d.Api.register("rowGroup().disable()",function(){return this.iterator("table",function(g){if(g.rowGroup){g.rowGroup.enable(false)}})});d.Api.register("rowGroup().enable()",function(g){return this.iterator("table",function(h){if(h.rowGroup){h.rowGroup.enable(g===f?true:g)}})});d.Api.register("rowGroup().dataSrc()",function(g){if(g===f){return this.context[0].rowGroup.dataSrc()}return this.iterator("table",function(h){if(h.rowGroup){h.rowGroup.dataSrc(g)}})});e(a).on("preInit.dt.dtrg",function(k,h,g){if(k.namespace!=="dt"){return}var l=h.oInit.rowGroup;var j=d.defaults.rowGroup;if(l||j){var i=e.extend({},j,l);if(l!==false){new b(h,i)}}});return b}));




© 2015 - 2025 Weber Informatics LLC | Privacy Policy