From 499c950c89edf644de9f062ff4046db47dd9b99b Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 20 Mar 2019 16:10:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9BUG=EF=BC=9A=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E7=95=8C=E9=9D=A2=E5=A2=9E=E5=8A=A0=E5=B8=A6=E5=B1=82?= =?UTF-8?q?=E6=AC=A1=E5=8A=9F=E8=83=BD=E5=90=8E=E6=9F=A5=E8=AF=A2=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E4=B8=8D=E6=AD=A3=E7=A1=AE=20closed=20#IU1SM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #Issue https://gitee.com/LongbowEnterprise/dashboard/issues?id=IU1SM --- Bootstrap.Admin/wwwroot/js/menus.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Bootstrap.Admin/wwwroot/js/menus.js b/Bootstrap.Admin/wwwroot/js/menus.js index 39293dd8..f1aeffff 100644 --- a/Bootstrap.Admin/wwwroot/js/menus.js +++ b/Bootstrap.Admin/wwwroot/js/menus.js @@ -138,13 +138,21 @@ $(function () { } ], idField: "Id", - //在哪一列展开树形 treeShowField: 'Name', - //指定父id列 parentIdField: 'ParentId', - - onResetView: function (data) { - //console.log('load'); + onPreBody: function(data) { + if($('#txt_parent_menus_name').val() !== '') { + this.treeShowField = false; + } + else { + this.treeShowField = 'Name'; + } + var bt = $table.data('bootstrap.table'); + if(bt) { + bt.treeEnable = !!this.treeShowField; + } + }, + onResetView: function () { $table.treegrid({ treeColumn: 2, expanderExpandedClass: 'fa fa-chevron-circle-down', @@ -153,7 +161,6 @@ $(function () { $table.bootstrapTable('resetWidth'); } }); - //只展开树形的第一级节点 $table.treegrid('getRootNodes').treegrid('expand'); }, onCheckRoot: function (row, data) {