Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

添加隐藏checkbox属性 #343

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,12 @@ Whether or not a node is selected.
#### tags
`Array of Strings` `Optional`

#### hideCheckbox

`Boolean` `Default: true`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+'Boolean' 'Default: false'

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a property to hide the checkbox


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
Expand Down
11 changes: 6 additions & 5 deletions src/js/bootstrap-treeview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down