Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve ClearFilter() Perfermance #491

Closed
kent3513 opened this issue Aug 26, 2015 · 0 comments
Closed

Improve ClearFilter() Perfermance #491

kent3513 opened this issue Aug 26, 2015 · 0 comments

Comments

@kent3513
Copy link

I got a performance issue on ClearFiliter(). I made a little change to improve it.
The original code will reset all node's title for clear as follow:

$.ui.fancytree._FancytreeClass.prototype.clearFilter = function(){
    this.visit(function (node) {
        delete node.match;
        delete node.subMatchCount;
        $(">span.fancytree-title", node.span).html(node.title);
        delete node.titleWithHighlight;
...
}

I add an if statement for reset the matched node's title. as follows:

$.ui.fancytree._FancytreeClass.prototype.clearFilter = function(){
    this.visit(function (node) {
        if (node.match)
        {
            $(">span.fancytree-title", node.span).html(node.title);
        }
        delete node.match;
        delete node.subMatchCount;
......
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants