jQWidgets Forums

jQuery UI Widgets Forums Navigation Tree how to optimize getRecordsHierarchy

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 11 years, 12 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • how to optimize getRecordsHierarchy #19859

    ryan paul
    Participant

    i notice that getRecordsHierarchy is very slow and making the browser tired in loading large data for tree when using getRecordsHierarchy.

    is there any way to optimize this approach?

    how to optimize getRecordsHierarchy #19869

    Peter Stoev
    Keymaster

    Hi ryan paul,

    You can populate the Tree in multiple different ways.

    In case you can provide the data in that format, you will bypass other method calls:

               var source = [
    { icon: "../../images/mailIcon.png", label: "Mail", expanded: true, items: [
    { icon: "../../images/calendarIcon.png", label: "Calendar" },
    { icon: "../../images/contactsIcon.png", label: "Contacts", selected: true }
    ]
    },
    { icon: "../../images/folder.png", label: "Inbox", expanded: true, items: [
    { icon: "../../images/folder.png", label: "Admin" },
    { icon: "../../images/folder.png", label: "Corporate" },
    { icon: "../../images/folder.png", label: "Finance" },
    { icon: "../../images/folder.png", label: "Other" },
    ]
    },
    { icon: "../../images/recycle.png", label: "Deleted Items" },
    { icon: "../../images/notesIcon.png", label: "Notes" },
    { iconsize: 14, icon: "../../images/settings.png", label: "Settings" },
    { icon: "../../images/favorites.png", label: "Favorites" },
    ];

    Please, note that getRecordsHierarchy has 2 flat loops and it just iterates through your data. It should not be the slow part in the code.

    Best Regards,
    Peter Stoev

    jQWIdgets Team
    http://www.jqwidgets.com/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.