| 1234567 |
- /*
- * bootstrap-table - v1.12.2 - 2018-11-29
- * https://github.com/wenzhixin/bootstrap-table
- * Copyright (c) 2018 zhixin wen
- * Licensed MIT License
- */
- !function(a){"use strict";a.extend(a.fn.bootstrapTable.defaults,{treeShowField:null,idField:"id",parentIdField:"pid",onGetNodes:function(b,c){var d=this,e=[];return a.each(c,function(a,c){b[d.options.idField]===c[d.options.parentIdField]&&e.push(c)}),e},onCheckRoot:function(a){var b=this;return!a[b.options.parentIdField]}});var b=a.fn.bootstrapTable.Constructor,c=b.prototype.init,d=b.prototype.initRow,e=b.prototype.initHeader,f=null;b.prototype.init=function(){f=this.options.rowStyle,c.apply(this,Array.prototype.slice.apply(arguments))},b.prototype.initHeader=function(){var b=this;e.apply(b,Array.prototype.slice.apply(arguments));var c=b.options.treeShowField;c&&a.each(this.header.fields,function(a,d){return c===d?(b.treeEnable=!0,!1):void 0})};var g=function(b,c,e,h){var i=this,j=i.options.onGetNodes.apply(i,[b,e]);b._nodes=j,h.append(d.apply(i,[b,c,e,h]));for(var k=j.length-1,l=0;k>=l;l++){var m=j[l];m._level=b._level+1,m._parent=b,l===k&&(m._last=1),i.options.rowStyle=function(a){var b=f.apply(i,Array.prototype.slice.apply(arguments)),c=a[i.options.idField]?a[i.options.idField]:0,d=a[i.options.parentIdField]?a[i.options.parentIdField]:0;return b.classes=[b.classes||"","treegrid-"+c,"treegrid-parent-"+d].join(" "),b},g.apply(i,[m,a.inArray(m,e),e,h])}};b.prototype.initRow=function(a,b,c,e){var h=this;return h.treeEnable?h.options.onCheckRoot.apply(h,[a,c])?(void 0===a._level&&(a._level=0),h.options.rowStyle=function(a){var b=f.apply(h,Array.prototype.slice.apply(arguments)),c=a[h.options.idField]?a[h.options.idField]:0;return b.classes=[b.classes||"","treegrid-"+c].join(" "),b},g.apply(h,[a,b,c,e]),!0):!1:d.apply(h,Array.prototype.slice.apply(arguments))}}(jQuery);
|