/* * bootstrap-table - v1.12.1 - 2018-03-12 * https://github.com/wenzhixin/bootstrap-table * Copyright (c) 2018 zhixin wen * Licensed MIT License */ !function(a){"use strict";var b,c="data-tt-id",d="data-tt-parent-id",e={},f=void 0,g=function(b,c){for(var d=b.$body.find("tr").not("[data-tt-parent-id]"),e=0;e0&&(b.options.loaded=!0,b.options.originalData=b.options.data,b.options.data=d),d};a.extend(a.fn.bootstrapTable.defaults,{groupBy:!1,groupByField:[],groupBySumGroup:!1,groupByInitExpanded:void 0,loaded:!1,originalData:void 0}),a.fn.bootstrapTable.methods.push("collapseAll","expandAll","refreshGroupByField"),a.extend(a.fn.bootstrapTable.COLUMN_DEFAULTS,{groupBySumGroup:!1});var n=a.fn.bootstrapTable.Constructor,o=n.prototype.init,p=n.prototype.initData;n.prototype.init=function(){if(!this.options.sortName&&this.options.groupBy&&this.options.groupByField.length>0){var c=this;Object.keys||a.fn.bootstrapTable.utils.objectKeys(),this.options.loaded=!1,this.options.originalData=void 0,b=this.options.rowAttributes,this.options.rowAttributes=i,this.$el.off("post-body.bs.table").on("post-body.bs.table",function(){c.$el.treetable({expandable:!0,onNodeExpand:function(){c.options.height&&c.resetHeader()},onNodeCollapse:function(){c.options.height&&c.resetHeader()}},!0),void 0!==c.options.groupByInitExpanded&&("number"==typeof c.options.groupByInitExpanded?c.expandNode(c.options.groupByInitExpanded):"all"===c.options.groupByInitExpanded.toLowerCase()&&c.expandAll())})}o.apply(this,Array.prototype.slice.apply(arguments))},n.prototype.initData=function(a,b){this.options.sortName||this.options.groupBy&&this.options.groupByField.length>0&&(this.options.groupByField="string"==typeof this.options.groupByField?this.options.groupByField.replace("[","").replace("]","").replace(/ /g,"").toLowerCase().split(","):this.options.groupByField,a=m(this,a?a:this.options.data)),p.apply(this,[a,b])},n.prototype.expandAll=function(){this.$el.treetable("expandAll")},n.prototype.collapseAll=function(){this.$el.treetable("collapseAll")},n.prototype.expandNode=function(a){a=g(this,a),void 0!==a&&this.$el.treetable("expandNode",a)},n.prototype.refreshGroupByField=function(b){a.fn.bootstrapTable.utils.compareObjects(this.options.groupByField,b)||(this.options.groupByField=b,this.load(this.options.originalData))}}(jQuery);