Skip to content

fix tree diagram leaves label formatter don't work #11385 #8534 #11556

Merged
deqingli merged 3 commits intoapache:masterfrom
deqingli:master
Nov 6, 2019
Merged

fix tree diagram leaves label formatter don't work #11385 #8534 #11556
deqingli merged 3 commits intoapache:masterfrom
deqingli:master

Conversation

@deqingli
Copy link
Copy Markdown
Member

@deqingli deqingli commented Nov 4, 2019

No description provided.

nodeData.wrapMethod('getItemModel', function (model, idx) {
var node = tree.getNodeByDataIndex(idx);
var leavesModel = node.getLeavesModel();
if (node.children.length === 0 || (node.children.length !== 0 && node.isExpand === false)) {
Copy link
Copy Markdown
Contributor

@pissang pissang Nov 6, 2019

Choose a reason for hiding this comment

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

A small suggestion on optimizing code.

I think this can be simplify to

if (!node.children.length || !node.isExpand) {
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thank you for your suggestion, I have fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants