代码拉取完成,页面将自动刷新
同步操作将从 Swifly/bootstrap-treetable 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/**
* bootstrap-treetable
* v1.0.10-beta
* @author swifly
* @url https://gitee.com/cyf783/bootstrap-treetable/
*/
!function(a){"use strict";var b=function(b,c){this.options=c,this.$el=a(b),this.$el_=this.$el.clone(),this.$headerBox=null,this.$leftBox=null,this.data_list=null,this.data_obj=null,this.hiddenColumns=[],this.lastAjaxParams=null,this.hasSelectItem=!1,this.leftFixedColumns=[],this.noFixedColumns=[],this.expandColumnIsFixed=!1,this.hasFixedColumn=!1,this.selectedDataIds=[],this.expandColumnField=null,this.init()};b.prototype.init=function(a){this.initOptions(),this.initContainer(),this.initToolbar(),this.initHeader(),this.initBody(),this.initServer(a)},b.prototype.initOptions=function(){var c=this;a.each(c.options.columns,function(d,e){e=a.extend({},b.COLUMN_DEFAULTS,e),e.width&&(e.width+=-1==e.width.indexOf("%")&&-1==e.width.indexOf("px")?"px":""),e.checkbox||e.radio?(c.hasSelectItem=!0,c.leftFixedColumns.push(e)):e.fixed?(("left"==e.fixed||1==e.fixed)&&c.leftFixedColumns.push(e),c.options.expandColumn==d&&(c.expandColumnIsFixed=!0)):("undefined"!=typeof e.visible&&1!=e.visible&&c.hiddenColumns.push(e.field),c.noFixedColumns.push(e)),c.options.expandColumn==d&&(c.expandColumnField=e.field)}),1==c.leftFixedColumns.length?(c.noFixedColumns.unshift(c.leftFixedColumns[0]),c.leftFixedColumns.pop()):c.hasFixedColumn=!0},b.prototype.initContainer=function(){var b=this,c=a("<div class='bootstrap-tree-table'></div>"),d=a("<div class='treetable-box'></div>"),e=a("<div class='treetable-body-box'></div>");b.$el.before(c),c.append(d),d.append(e),e.append(b.$el),b.$el.addClass("table treetable-table"),b.options.striped&&b.$el.addClass("table-striped"),b.options.bordered&&d.addClass("treetable-bordered"),b.options.condensed&&b.$el.addClass("table-condensed"),b.options.width&&(c.css("width",b.options.width),d.css("width",b.options.width)),b.options.height&&e.css("height",b.options.height),b.$el.html("")},b.prototype.initToolbar=function(){var d,e,f,g,b=this,c=a("<div class='treetable-bars'></div>");b.options.toolbar&&(a(b.options.toolbar).addClass("tool-left"),c.append(a(b.options.toolbar))),d=a('<div class="btn-group tool-right">'),c.append(d),b.$el.parent().parent().before(c),b.options.showRefresh&&(e=a('<button class="btn btn-default btn-outline refresh_btn" type="button" aria-label="refresh" title="刷新"><i class="'+b.options.toolRefreshClass+'"></i></button>'),d.append(e)),b.options.showColumns&&(f=a('<div class="btn-group pull-right" title="列"><button type="button" aria-label="columns" class="btn btn-default btn-outline dropdown-toggle" data-toggle="dropdown" aria-expanded="false"><i class="'+b.options.toolColumnsClass+'"></i> <span class="caret"></span></button></div>'),g=a('<ul class="dropdown-menu dropdown-menu-right columns" role="menu"></ul>'),a.each(b.leftFixedColumns,function(b,c){if(!c.checkbox&&!c.radio){var d=a('<li role="menuitem"><label><input type="checkbox" checked="checked" disabled data-field="'+c.field+'" value="'+c.field+'" > '+c.title+"</label></li>");g.append(d)}}),a.each(b.noFixedColumns,function(b,c){if(!c.checkbox&&!c.radio){var d=a('<li role="menuitem"><label><input type="checkbox" checked="checked" data-field="'+c.field+'" value="'+c.field+'" > '+c.title+"</label></li>");g.append(d)}}),f.append(g),d.append(f))},b.prototype.initHiddenColumns=function(){var b=this;a.each(b.hiddenColumns,function(c,d){var f,e=a.inArray(d,b.leftFixedColumns);e>-1||(b.$el.parent().parent().find("."+d+"_cls").hide(),f=a(".bootstrap-tree-table .treetable-bars .columns label").find("input[value='"+d+"']"),f.prop("checked",""))})},b.prototype.initHeader=function(){var e,f,b=this,c=a("<tr></tr>"),d=b.leftFixedColumns.concat(b.noFixedColumns);a.each(d,function(b,d){var e;e=0==b&&(d.checkbox||d.radio)?a('<th style="width:36px"></th>'):a('<th style="'+(d.width?"width:"+d.width:"")+'" class="'+d.field+'_cls"></th>'),e.text(d.title),c.append(e)}),e=a('<thead class="treetable-thead"></thead>'),e.append(c),b.$el.append(e),b.$headerBox=a("<div class='treetable-fixed treetable-head-box'></div>"),f=a("<table id='"+b.$el.attr("id")+"_header'></table>"),b.$headerBox.append(f),b.$el.parent().before(b.$headerBox),b.cloneTable(b.$el,f,0,d.length-1),b.$el.find("thead th").each(function(b,c){a(c).html("")}),b.$el.parent().scroll(function(){var a=b.$el.parent().scrollLeft();b.$headerBox.find("#"+b.$el.attr("id")+"_header").parent().css({left:-a})})},b.prototype.initBody=function(){var b=this,c=a('<tbody class="treetable-tbody"></tbody>');b.$el.append(c)},b.prototype.initServer=function(b){var d,e,c=this;c.data_list={},c.data_obj={},d=c.$el.find("tbody"),e='<tr><td colspan="'+c.options.columns.length+'"><div style="display: block;text-align: center;">正在努力地加载数据中,请稍候……</div></td></tr>',d.html(e),c.options.url?a.ajax({type:c.options.type,url:c.options.url,data:b?b:c.options.ajaxParams,dataType:"JSON",success:function(b){c.renderTable(b),c.trigger("load-success",b),a(window).resize(function(){c.autoReSize()})},error:function(a,b){var e='<tr><td colspan="'+c.options.columns.length+'"><div style="display: block;text-align: center;">'+a.responseText+"</div></td></tr>";d.html(e),c.trigger("load-error",b,a)}}):c.options.data?(c.renderTable(c.options.data),c.trigger("load-success",c.options.data),a(window).resize(function(){c.autoReSize()})):c.trigger("load-error")},b.prototype.renderTable=function(b){var e,f,c=this,d=c.$el.find("tbody");return d.html(""),!b||b.length<=0?(e='<tr><td colspan="'+c.options.columns.length+'"><div style="display: block;text-align: center;">没有找到匹配的记录</div></td></tr>',d.html(e),void 0):(c.formatData(b),f=c.data_list["_root_"],f&&a.each(f,function(a,b){var d="row_id_"+a;c.recursionNode(b,1,d,"row_root")}),a.each(b,function(a,b){if(!b.isShow){var e=c.renderRow(b,!1,1,"","");d.append(e)}}),c.$el.append(d),c.initHiddenColumns(),c.frozen(),c.autoReSize(),c.registerRowEvent(),c.registerExpanderEvent(),c.options.showRefresh&&c.registerRefreshBtnClickEvent(),c.options.showColumns&&c.registerColumnClickEvent(),void 0)},b.prototype.autoReSize=function(){var g,h,b=this,c=b.$el.find("thead"),d=b.$headerBox.find("#"+b.$el.attr("id")+"_header"),e=d.find("thead"),f=c.children(":first").width();b.hasScroll(!0)?d.width(f+b.getScrollWidth()):(d.width("auto"),b.$el.parent().css("border-bottom","0")),e.css("width",f),b.$el.parent().parent().find(".treetable-body-box").css("margin-top",d.height()),g=b.$el.parent().scrollLeft(),h=b.$el.parent().scrollTop(),b.$el.parent().parent().find("#"+b.$el.attr("id")+"_header").parent().css({left:-g}),b.$el.parent().parent().find(".treetable-fixed .treetable-body-box").each(function(b,c){a(c).scrollTop(h)})},b.prototype.frozen=function(){var c,e,f,h,i,j,k,l,b=this;b.$leftBox&&b.$leftBox.remove(),c=b.$el,c.attr("id"),e=c.parent(),f=e.parent(),b.noFixedColumns.length,h=b.leftFixedColumns.length,c.find("td").attr("noWrap","nowrap"),b.leftFixedColumns.length>0&&(b.$leftBox=a("<div class='treetable-fixed treetable-fixed-l'></div>"),i=a("<div></div>"),b.mergeAttributes(e,i),i.addClass("treetable-fixed"),j=a("<table></table>"),b.$leftBox.append(i),i.append(j),f.append(b.$leftBox),b.cloneTable(b.$el,j,0,h-1),b.$leftBox.css("left",f.offset().left),b.$leftBox.css("top",0),i.height(i.height()-b.getScrollWidth()-2),k=a("<div class='treetable-fixed treetable-head-box'></div>"),b.$leftBox.append(k),l=a("<table></table>"),k.append(l),b.cloneTable(f.find("#"+c.attr("id")+"_header"),l,0,h-1),l.removeAttr("style"),l.find("thead").removeAttr("style"),e.scroll(function(){var b=e.scrollLeft(),d=e.scrollTop();f.find("#"+c.attr("id")+"_header").parent().css({left:-b}),f.find(".treetable-fixed .treetable-body-box").each(function(b,c){a(c).scrollTop(d)})}))},b.prototype.cloneTable=function(b,c,d,e){var g,h,f=this;f.mergeAttributes(b,c),b.find("thead")&&b.find("thead").length>0&&(g=a("<thead></thead>"),f.mergeAttributes(b.find("thead"),g),b.find("thead tr").each(function(b,c){var h=a("<tr></tr>");f.mergeAttributes(a(c),h),a(c).find("th").each(function(b,c){b>=d&&e>=b&&h.append(a(c).clone(!0))}),g.append(h)}),c.append(g)),b.find("tbody")&&b.find("tbody").length>0&&(h=a("<tbody></tbody>"),f.mergeAttributes(b.find("tbody"),h),b.find("tbody tr").each(function(b,c){var g=a("<tr></tr>");f.mergeAttributes(a(c),g),a(c).find("td").each(function(b,c){b>=d&&e>=b&&g.append(a(c).clone(!0))}),h.append(g)}),c.append(h))},b.prototype.mergeAttributes=function(a,b){for(var e,c=a.get(0).attributes,d=c.length-1;d>=0;d--)if(e=c[d].name,"id"!==e.toLowerCase()&&""!=c[d].value&&null!=c[d].value&&"null"!=c[d].value)try{b.attr(e,c[d].value)}catch(f){}},b.prototype.formatData=function(b){var c=this,d=c.options.rootIdValue?c.options.rootIdValue:null;a.each(b,function(a,b){b.isShow=!1;var e="0"==b[c.options.parentId]||0==b[c.options.parentId]||null==b[c.options.parentId]||""==b[c.options.parentId];!b[c.options.parentId]||(d?b[c.options.parentId]==c.options.rootIdValue:e)?(c.data_list["_root_"]||(c.data_list["_root_"]=[]),c.data_obj["id_"+b[c.options.id]]||c.data_list["_root_"].push(b)):(c.data_list["_n_"+b[c.options.parentId]]||(c.data_list["_n_"+b[c.options.parentId]]=[]),c.data_obj["id_"+b[c.options.id]]||c.data_list["_n_"+b[c.options.parentId]].push(b)),c.data_obj["id_"+b[c.options.id]]=b})},b.prototype.recursionNode=function(b,c,d,e){var f=this,g=f.$el.find("tbody"),h=f.data_list["_n_"+b[f.options.id]],i=f.renderRow(b,h?!0:!1,c,d,e);g.append(i),h&&a.each(h,function(a,b){var e=d+"_"+a;f.recursionNode(b,c+1,e,d)})},b.prototype.renderRow=function(b,c,d,e,f){var h,i,j,g=this;return b.isShow=!0,b.row_id=e,b.p_id=f,b.lv=d,h=a('<tr rid="'+e+'" pid="'+f+'" dataid="'+b[g.options.id]+'"></tr>'),i=g.options.expanderCollapsedClass,g.options.expandAll?(h.css("display","table"),i=g.options.expanderExpandedClass):1==d?(h.css("display","table"),i=g.options.expandFirst?g.options.expanderExpandedClass:g.options.expanderCollapsedClass):2==d?(g.options.expandFirst?h.css("display","table"):h.css("display","none"),i=g.options.expanderCollapsedClass):(h.css("display","none"),i=g.options.expanderCollapsedClass),j=g.leftFixedColumns.concat(g.noFixedColumns),a.each(j,function(e,f){var j,k,l;if(f.checkbox||f.radio)j=a('<td style="text-align:center;width:36px"></td>'),f.radio&&(k=a('<input name="select_item" type="radio" value="'+b[g.options.id]+'"></input>'),j.append(k)),f.checkbox&&(k=a('<input name="select_item" type="checkbox" value="'+b[g.options.id]+'"></input>'),j.append(k)),h.append(j);else{if(j=a('<td name="'+f.field+'" class="'+f.field+'_cls"></td>'),f.width&&j.css("width",f.width),f.align&&j.css("text-align",f.align),g.expandColumnField==f.field&&j.css("text-align","left"),f.valign&&j.css("vertical-align",f.valign),g.options.showTitle&&j.addClass("ellipsis"),f.formatter?j.html(f.formatter.call(g,b[f.field],b,e)):(g.options.showTitle&&j.attr("title",b[f.field]),j.text(b[f.field])),g.expandColumnField==f.field)for(c?j.prepend('<span class="treetable-expander '+i+'"></span>'):j.prepend('<span class="treetable-expander"></span>'),l=0;d-1>l;l++)j.prepend('<span class="treetable-indent"></span>');h.append(j)}}),h},b.prototype.hasScroll=function(a){var b=this,c=b.$el.parent()[0];return a&&c.scrollHeight>c.clientHeight?!0:!a&&c.offsetHeight-c.clientHeight>0?!0:!1},b.prototype.getScrollWidth=function(a){var b=0;return a?b=a.offsetWidth-a.clientWidth:(a=document.createElement("div"),a.style.width="100px",a.style.height="100px",a.style.overflowY="scroll",document.body.appendChild(a),b=a.offsetWidth-a.clientWidth,document.body.removeChild(a)),b},b.prototype.registerRefreshBtnClickEvent=function(){var b=this;a(".bootstrap-tree-table .treetable-bars .tool-right .refresh_btn").off("click").on("click",function(){b.refresh()})},b.prototype.registerColumnClickEvent=function(){var b=this;a(".bootstrap-tree-table .treetable-bars .columns label input").off("click").on("click",function(){var c=a(this);c.prop("checked")?b.showColumn(a(this).val()):b.hideColumn(a(this).val())})},b.prototype.registerRowEvent=function(){var b=this;b.$el.parent().parent().find("tbody").find("tr").find("td").off("click dblclick").on("click dblclick",function(c){var i,j,d=a(this),e=d.parent(),f=b.data_obj["id_"+e.attr("dataid")],g=d.attr("name"),h=f[g];b.trigger("click"===c.type?"click-cell":"dbl-click-cell",g,h,f,d),b.trigger("click"===c.type?"click-row":"dbl-click-row",f,e,g),b.hasSelectItem&&(i=e.find("input[name='select_item']"),j=i.val(),"radio"==i.attr("type")?b.selectedDataIdsManager(j):i.prop("checked")?b.selectedDataIdsManager(j,!0,!1):b.selectedDataIdsManager(j,!0,!0))}),b.$el.parent().parent().find("tbody").find("tr").find(":first-child").find("input[type='checkbox']").off("click dblclick"),b.$el.parent().parent().find("tbody").find("tr").find(":first-child").find("input[type='checkbox']").change(function(){b.selectedDataIdsManager(a(this).val(),!0,a(this).is(":checked"))}),b.options.hover&&b.$el.parent().parent().find("tbody").on("mouseenter","tr",function(){var c=a(this),d=c.index();b.$el.parent().parent().find("tbody").find("tr:eq("+d+")").addClass("treetable-hover")}).on("mouseleave","tr",function(){var c=a(this),d=c.index();b.$el.parent().parent().find("tbody").find("tr:eq("+d+")").removeClass("treetable-hover")})},b.prototype.selectedDataIdsManager=function(b,c,d){var h,e=this,f=e.$el.find("tbody").find("tr").find(":first-child").find("input[value='"+b+"']"),g=null;e.hasFixedColumn&&(g=e.$leftBox.find("tbody").find("tr").find(":first-child").find("input[value='"+b+"']")),c?(h=a.inArray(b,e.selectedDataIds),d?h>-1||(e.selectedDataIds.push(b),e.hasFixedColumn&&(g.parent().parent().addClass("treetable-selected"),g.prop("checked",!0)),f.parent().parent().addClass("treetable-selected"),f.prop("checked",!0)):h>-1&&(e.selectedDataIds.splice(h,1),e.hasFixedColumn&&(g.parent().parent().removeClass("treetable-selected"),g.prop("checked","")),f.parent().parent().removeClass("treetable-selected"),f.prop("checked",""))):(e.selectedDataIds=[],e.selectedDataIds.push(b),e.hasFixedColumn&&(e.$leftBox.find("tbody").find("tr").removeClass("treetable-selected"),g.parent().parent().addClass("treetable-selected"),g.prop("checked",!0)),e.$el.find("tbody").find("tr").removeClass("treetable-selected"),f.parent().parent().addClass("treetable-selected"),f.prop("checked",!0))},b.prototype.registerExpanderEvent=function(){var b=this;b.$el.find("tbody").find("tr").find(".treetable-expander").off("click").on("click",function(){var e,f,c=a(this).hasClass(b.options.expanderExpandedClass),d=a(this).hasClass(b.options.expanderCollapsedClass);(c||d)&&(e=a(this).parent().parent(),f=e.attr("dataid"),b.toggleRow(f))}),b.hasFixedColumn&&b.expandColumnIsFixed&&b.$leftBox.find(".treetable-body-box table tbody").find("tr").find(".treetable-expander").off("click").on("click",function(){var e,f,c=a(this).hasClass(b.options.expanderExpandedClass),d=a(this).hasClass(b.options.expanderCollapsedClass);(c||d)&&(e=a(this).parent().parent(),f=e.attr("dataid"),b.toggleRow(f))})},b.prototype.refresh=function(a){var b=this;b.destroy(),a&&(b.lastAjaxParams=a),b.init(b.lastAjaxParams)},b.prototype.appendData=function(b){var c=this;a.each(b,function(a,b){var j,k,l,m,n,o,p,q,d=c.data_obj["id_"+b[c.options.id]],e=c.data_obj["id_"+b[c.options.parentId]],f=c.data_list["_n_"+b[c.options.parentId]],g="",h="",i=1;d&&d.row_id&&""!=d.row_id&&(g=d.row_id),e?(h=e.row_id,k=0,""==g?(f&&f.length>0&&(k=f.length),g=e.row_id+"_"+k):(l=g.split("_"),k=l[l.length-1]),i=e.lv+1,j=c.renderRow(b,!1,i,g,h),m=c.$el.find("tr[rid='"+e.row_id+"']").find(".treetable-expander"),n=m.hasClass(c.options.expanderExpandedClass),o=m.hasClass(c.options.expanderCollapsedClass),n||o?n&&j.css("display","table"):m.addClass(c.options.expanderCollapsedClass),d&&c.$el.find("tr[rid='"+d.row_id+"']").remove(),0==k?c.$el.find("tr[rid='"+e.row_id+"']").after(j):c.$el.find("tr[rid='"+e.row_id+"_"+(k-1)+"']").after(j)):(j=c.renderRow(b,!1,i,g,h),d?(p=c.$el.find("tr[rid='"+d.row_id+"']").prev(),c.$el.find("tr[rid='"+d.row_id+"']").remove(),p.after(j)):(q=c.$el.find("tbody"),q.append(j))),b.isShow=!0,c.formatData([b])}),c.initHiddenColumns(),c.frozen(),c.autoReSize(),c.registerRowEvent(),c.registerExpanderEvent()},b.prototype.toggleRow=function(b){var j,k,l,m,c=this,d=c.data_obj["id_"+b],e=c.$el.find("tr[rid='"+d.row_id+"']"),f=e.attr("rid"),g=e.find(".treetable-expander"),h=g.hasClass(c.options.expanderExpandedClass),i=g.hasClass(c.options.expanderCollapsedClass);(h||i)&&(j=c.$el.find("tbody").find("tr[rid^='"+f+"_']"),h?(g.removeClass(c.options.expanderExpandedClass),g.addClass(c.options.expanderCollapsedClass),j&&j.length>0&&a.each(j,function(b,c){a(c).css("display","none")})):(g.removeClass(c.options.expanderCollapsedClass),g.addClass(c.options.expanderExpandedClass),j&&j.length>0&&a.each(j,function(b,d){var e=a("tr[rid='"+a(d).attr("pid")+"']").find(".treetable-expander");e.hasClass(c.options.expanderExpandedClass)&&a(d).css("display","table")})),c.hasFixedColumn&&(k=c.$leftBox.find("tr[rid='"+d.row_id+"']"),l=c.$leftBox.find(".treetable-body-box table tbody").find("tr[rid^='"+f+"_']"),h?l&&l.length>0&&a.each(l,function(b,c){a(c).css("display","none")}):l&&l.length>0&&a.each(l,function(b,d){var e=a("tr[rid='"+a(d).attr("pid")+"']").find(".treetable-expander");e.hasClass(c.options.expanderExpandedClass)&&a(d).css("display","table")}),c.expandColumnIsFixed&&(m=k.find(".treetable-expander"),h?(m.removeClass(c.options.expanderExpandedClass),m.addClass(c.options.expanderCollapsedClass)):(m.removeClass(c.options.expanderCollapsedClass),m.addClass(c.options.expanderExpandedClass)))),c.autoReSize())},b.prototype.expandRow=function(a){var b=this,c=b.data_obj["id_"+a],d=b.$el.find("tr[rid='"+c.row_id+"']"),e=d.find(".treetable-expander"),f=e.hasClass(b.options.expanderExpandedClass),g=e.hasClass(b.options.expanderCollapsedClass);(f||g)&&g&&b.toggleRow(a)},b.prototype.collapseRow=function(a){var b=this,c=b.data_obj["id_"+a],d=b.$el.find("tr[rid='"+c.row_id+"']"),e=d.find(".treetable-expander"),f=e.hasClass(b.options.expanderExpandedClass),g=e.hasClass(b.options.expanderCollapsedClass);(f||g)&&f&&b.toggleRow(a)},b.prototype.expandAll=function(){var b=this;b.hasFixedColumn&&b.expandColumnIsFixed?b.$leftBox.find("tbody").find("tr").find(".treetable-expander").each(function(c,d){var f,g,e=a(d).hasClass(b.options.expanderCollapsedClass);e&&(f=a(d).parent().parent(),g=f.attr("dataid"),b.toggleRow(g))}):b.$el.find("tbody").find("tr").find(".treetable-expander").each(function(c,d){var f,g,e=a(d).hasClass(b.options.expanderCollapsedClass);e&&(f=a(d).parent().parent(),g=f.attr("dataid"),b.toggleRow(g))})},b.prototype.collapseAll=function(){var b=this;b.hasFixedColumn&&b.expandColumnIsFixed?b.$leftBox.find("tbody").find("tr").find(".treetable-expander").each(function(c,d){var f,g,e=a(d).hasClass(b.options.expanderExpandedClass);e&&(f=a(d).parent().parent(),g=f.attr("dataid"),b.toggleRow(g))}):b.$el.find("tbody").find("tr").find(".treetable-expander").each(function(c,d){var f,g,e=a(d).hasClass(b.options.expanderExpandedClass);e&&(f=a(d).parent().parent(),g=f.attr("dataid"),b.toggleRow(g))})},b.prototype.showColumn=function(b){var d,e,c=this;a.each(c.leftFixedColumns,function(a,c){c.field==b}),d=a.inArray(b,c.hiddenColumns),d>-1&&c.hiddenColumns.splice(d,1),c.$el.parent().parent().find("."+b+"_cls").show(),c.options.showColumns&&(e=a(".bootstrap-tree-table .treetable-bars .columns label").find("input[value='"+b+"']"),e.prop("checked","checked")),c.autoReSize()},b.prototype.hideColumn=function(b){var d,c=this;a.each(c.leftFixedColumns,function(a,c){c.field==b}),c.hiddenColumns.push(b),c.$el.parent().parent().find("."+b+"_cls").hide(),c.options.showColumns&&(d=a(".bootstrap-tree-table .treetable-bars .columns label").find("input[value='"+b+"']"),d.prop("checked","")),c.autoReSize()},b.prototype.getSelections=function(){var c,b=this;return b.selectedDataIds?(c=[],a.each(b.selectedDataIds,function(a,d){var e=b.data_obj["id_"+d];c.push(e)}),c):void 0},b.prototype.trigger=function(c){var d=this,e=Array.prototype.slice.call(arguments,1);c+=".bs.tree.table",d.options[b.EVENTS[c]].apply(d.options,e),d.$el.trigger(a.Event(c),e),d.options.onAll(c,e),d.$el.trigger(a.Event("all.bs.tree.table"),[c,e])},b.prototype.destroy=function(){var b=this,c=b.$el.parent().parent().parent();b.$el.insertBefore(c),a(b.options.toolbar).insertBefore(b.$el),b.$el.html(b.$el_.html()),c.remove(),b.$headerBox=null,b.$leftBox=null,b.selectedDataIds=[],b.hiddenColumns=[],b.leftFixedColumns=[],b.noFixedColumns=[],b.data_list=null,b.data_obj=null,b.lastAjaxParams=null,b.hasSelectItem=!1,b.expandColumnIsFixed=!1,b.hasFixedColumn=!1},b.METHODS=["getSelections","refresh","appendData","toggleRow","expandRow","collapseRow","expandAll","collapseAll","showColumn","hideColumn","destroy"],b.EVENTS={"all.bs.tree.table":"onAll","click-cell.bs.tree.table":"onClickCell","dbl-click-cell.bs.tree.table":"onDblClickCell","click-row.bs.tree.table":"onClickRow","dbl-click-row.bs.tree.table":"onDblClickRow","load-success.bs.tree.table":"onLoadSuccess","load-error.bs.tree.table":"onLoadError"},b.DEFAULTS={id:"id",parentId:"parentId",rootIdValue:null,data:null,type:"GET",url:null,ajaxParams:{},expandColumn:0,expandAll:!1,expandFirst:!0,striped:!1,bordered:!0,hover:!0,condensed:!1,columns:[],toolbar:null,width:0,height:0,showTitle:!0,showColumns:!0,showRefresh:!0,expanderExpandedClass:"bstt-icon bstt-chevron-down",expanderCollapsedClass:"bstt-icon bstt-chevron-right",toolRefreshClass:"bstt-icon bstt-refresh",toolColumnsClass:"bstt-icon bstt-columns",onAll:function(){return!1},onLoadSuccess:function(){return!1},onLoadError:function(){return!1},onClickCell:function(){return!1},onDblClickCell:function(){return!1},onClickRow:function(){return!1},onDblClickRow:function(){return!1}},b.COLUMN_DEFAULTS={radio:!1,checkbox:!1,field:void 0,title:void 0,align:void 0,valign:void 0,width:void 0,visible:!0,fixed:void 0,formatter:void 0},a.fn.bootstrapTreeTable=function(c){var d,e=Array.prototype.slice.call(arguments,1);return this.each(function(){var f=a(this),g=f.data("bootstrap.tree.table"),h=a.extend({},b.DEFAULTS,f.data(),"object"==typeof c&&c);if("string"==typeof c){if(a.inArray(c,b.METHODS)<0)throw new Error("Unknown method: "+c);if(!g)return;d=g[c].apply(g,e),"destroy"===c&&f.removeData("bootstrap.tree.table")}g||f.data("bootstrap.tree.table",g=new b(this,h))}),"undefined"==typeof d?this:d}}(jQuery);
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。