/** * @author: YL * @version: v1.0.0 */ !function ($) { 'use strict'; $.extend($.fn.bootstrapTable.defaults, { treeShowField: null, idField: 'id', parentIdField: 'pid', onGetNodes: function (row, data) { var that = this; var nodes = []; $.each(data, function (i, item) { if (row[that.options.idField] === item[that.options.parentIdField]) { nodes.push(item); } }); return nodes; }, onCheckRoot: function (row, data) { var that = this; //v2.2.1 修复parentid不为0时,不显示该记录的问题 for(var i=0,j=data.length;i