From 98fb892ef0d6d57cc3d6241d23bae0a845356498 Mon Sep 17 00:00:00 2001 From: "dong.keke" Date: Thu, 16 Mar 2017 15:01:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=9A=90=E8=97=8Fcheckbox?= =?UTF-8?q?=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 ++++++ src/js/bootstrap-treeview.js | 11 ++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c0a724235..057046009 100644 --- a/README.md +++ b/README.md @@ -214,6 +214,12 @@ Whether or not a node is selected. #### tags `Array of Strings` `Optional` +#### hideCheckbox + +`Boolean` `Default: true` + +Used to hide the checkbox of specific node in the tree. + Used in conjunction with global showTags option to add additional information to the right of each node; using [Bootstrap Badges](http://getbootstrap.com/components/#badges) ### Extendible diff --git a/src/js/bootstrap-treeview.js b/src/js/bootstrap-treeview.js index 7a82a2eeb..f223b2533 100644 --- a/src/js/bootstrap-treeview.js +++ b/src/js/bootstrap-treeview.js @@ -568,11 +568,12 @@ if (_this.options.showCheckbox) { var classList = ['check-icon']; - if (node.state.checked) { - classList.push(_this.options.checkedIcon); - } - else { - classList.push(_this.options.uncheckedIcon); + if(!node.hideCheckbox){ + if (node.state.checked) { + classList.push(_this.options.checkedIcon); + }else { + classList.push(_this.options.uncheckedIcon); + } } treeItem