!function(d){"use strict";d.extend(d.fn.bootstrapTable.defaults,{treeShowField:null,idField:"id",parentIdField:"pid",onGetNodes:function(o,e){var i=this;var n=[];d.each(e,function(e,t){if(o[i.options.idField]===t[i.options.parentIdField]){n.push(t)}});return n},onCheckRoot:function(e,t){var o=this;return!e[o.options.parentIdField]}});var e=d.fn.bootstrapTable.Constructor,f=e.prototype.initRow,t=e.prototype.initHeader;var u;e.prototype.initHeader=function(){var o=this;if(o.options.myRowStyle){u=o.options.myRowStyle}else{u=o.options.rowStyle;o.options.myRowStyle=u}t.apply(o,Array.prototype.slice.apply(arguments));var i=o.options.treeShowField;if(i){d.each(this.header.fields,function(e,t){if(i===t){o.treeEnable=true;return false}})}};var y=function(e,t,o,i){var n=this;i.append(f.apply(n,[e,t,o,i]));var r=e._nodes.length-1;for(var a=0;a<=r;a++){var p=e._nodes[a];p._level=e._level+1;if(a===r)p._last=1;var l={};if(u){l=u(p,t)}n.options.rowStyle=function(e,t){var o=e[n.options.idField]?e[n.options.idField]:0;var i=e[n.options.parentIdField]?e[n.options.parentIdField]:0;l.classes="treegrid-"+escapeCN(o)+" treegrid-parent-"+escapeCN(i);return l};var s=n.options.onGetNodes.apply(n,[p,o]);p._nodes=s;n.options.rowAttributes=function(e,t){return{"data-level":p._level,"data-leaf":s.length===0?1:0}};y.apply(n,[p,d.inArray(p,o),o,i])}};e.prototype.initRow=function(o,e,t,i){var n=this;if(n.treeEnable&&n.options.offTree===false){if(n.options.onCheckRoot.apply(n,[o,t])){if(o._level===undefined){o._level=0}var r={};if(u){r=u(o,e)}n.options.rowStyle=function(e,t){var o=e[n.options.idField]?e[n.options.idField]:0;r.classes=escapeCN("treegrid-"+o);return r};var a=n.options.onGetNodes.apply(n,[o,t]);o._nodes=a;n.options.rowAttributes=function(e,t){return{"data-level":o._level,"data-leaf":a.length===0?1:0}};y.apply(n,[o,e,t,i]);return true}return false}return f.apply(n,Array.prototype.slice.apply(arguments))}}(jQuery);